Question

In: Computer Science

Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your...

Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your solutions for each problem solved in a Word or Google document which includes (a) the pseudocode, (b) the C# codes and (c) the execution result (screen capture just the answer part using Snipping Tool, avoiding non-related or blank spaces). Notice for readability, that the (a) & (b) are in text mode and the (c) is in image mode. Use proper titles and wording in the results, such as Console.WriteLine("The total change to be made is {0:C}.", change); so that the results could be easily understood by a third party reader. For all 3 questions, assign the provided initial values to the variables or constants in the source code as input.

You may need to save the snipped image as a JPG file and then insert the file into the document, especially when you use a Google doc. Create just one document for all 3 solutions in this assignment. You may create the document directly from a cloud service or from you PC first and then upload it to a cloud. The possible cloud service could be Google Drive, Microsoft OneDrive, Dropbox, etc. To submit the document, click the "Write Submission" button under this assignment. Then use the opened editor box to submit the web address of your document on the cloud or, if you are not yet able to use a cloud service, submit the document as an attached file.

Q3. Write a C# program to convert one billion seconds (1,000,000,000 seconds) into years, months, days, hours, minutes, and seconds. And compute how many seconds are in 20 years, including 5 leap years.

Solutions

Expert Solution

using System;

namespace Billionseconds
{
class Program
{
static void Main(string[] args)
{
TimeSpan t = TimeSpan.FromSeconds(1000000000);

var Years = (t.Days / 365);
var months= ((t.Days) % 365)/30;
var Days = (t.Days % 365) % 30;

  
var Hours=(t.Hours);
var minutes=(t.Minutes);
var seconds=(t.Seconds);
Console.WriteLine(" {0} year(s), {1} month(s) {2} day(s) {3} hour(s) {4} minute(s) {5} and second(s)", Years, months,Days,Hours,minutes,seconds);

}
}
}

-----------------------------------------------------------------------------------------------------------------------------------------------------------

using System;


namespace yearstoseconds
{
class Program
{
static void Main(string[] args)
{
var years = 20;

//extra leapyear days are added

var totaldays = (years*365)+(years / 4);

int seconds = (totaldays * 86400);//1day=86400 seconds

Console.WriteLine("Total seconds:" + seconds);
}
}
}


Related Solutions

Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your...
Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your solutions for each problem solved in a Word or Google document which includes (a) the pseudocode, (b) the C# codes and (c) the execution result (screen capture just the answer part using Snipping Tool, avoiding non-related or blank spaces). Notice for readability, that the (a) & (b) are in text mode and the (c) is in image mode. Use proper titles and wording in...
C# Programming language!!! Using visual studios if possible!! PrimeHealth Suite You will create an application that...
C# Programming language!!! Using visual studios if possible!! PrimeHealth Suite You will create an application that serves as a healthcare billing management system. This application is a multiform project (Chapter 9) with three buttons. The "All Accounts" button allows the user to see all the account information for each patient which is stored in an array of class type objects (Chapter 9, section 9.4).The "Charge Service" button calls the Debit method which charges the selected service to the patient's account...
MUST BE WRITTEN IN ASSEMBLY LANGUAGE ONLY AND MUST COMPILE IN VISUAL STUDIO You will write...
MUST BE WRITTEN IN ASSEMBLY LANGUAGE ONLY AND MUST COMPILE IN VISUAL STUDIO You will write a simple assembly language program that performs a few arithmetic operations. This will require you to establish your programming environment and create the capability to assemble and execute the assembly programs that are part of this course. Your \student ID number is a 7-digit number. Begin by splitting your student ID into two different values. Assign the three most significant digits to a variable...
Answer the questions below as indicated. Note that you have to complete these using Visual Studio...
Answer the questions below as indicated. Note that you have to complete these using Visual Studio 2019. Upload the source code (.cpp) of your applications. Upload a separate (.cpp) file for each question. 1-Create a C++ program which adds two numbers and displays the sum. 2-Create a C++ program which calculates and displays the area of a rectangle. 3-Create a C++ program which calculates and displays the average of four numbers.. 4-Complete questions 3 of the chapter 3 Programming Exercises...
This programming assignment will consist of a C++ program. Your program must compile correctly and produce...
This programming assignment will consist of a C++ program. Your program must compile correctly and produce the specified output. Please note that your programs should comply with the commenting and formatting described in the Required Program Development Best Practices document that has been discussed in class and is posted to the eLearning system. Please see this descriptive file on the eLearning system for more details. The name to use in the main configuration screen text box Name: [ ] in...
Create an ASP.Net Website using Visual Studio with C#: Create a simple calculator that has 3...
Create an ASP.Net Website using Visual Studio with C#: Create a simple calculator that has 3 text boxes: 2 of them to enter numbers, the 3rd one displays the results Create 4 buttons to add, subtract, multiply, and divide Prevent the user from entering text in the number fields Display a message indicating “cannot divide by” when the user click “/” and there is a zero the in the second box Create two additional buttons: - One to store data...
Programming Language: C# CheckingAccount class You will implement the CheckingAccount Class in Visual Studio. This is...
Programming Language: C# CheckingAccount class You will implement the CheckingAccount Class in Visual Studio. This is a sub class is derived from the Account class and implements the ITransaction interface. There are two class variables i.e. variables that are shared but all the objects of this class. A short description of the class members is given below: CheckingAccount Class Fields $- COST_PER_TRANSACTION = 0.05 : double $- INTEREST_RATE = 0.005 : double - hasOverdraft: bool Methods + «Constructor» CheckingAccount(balance =...
Create an ASP.Net Website using Visual Studio with Visual Basic.Net: Create a simple calculator that has...
Create an ASP.Net Website using Visual Studio with Visual Basic.Net: Create a simple calculator that has 3 text boxes: 2 of them to enter numbers, the 3rd one displays the results Create 4 buttons to add, subtract, multiply, and divide Prevent the user from entering text in the number fields Display a message indicating “cannot divide by” when the user click “/” and there is a zero the in the second box Create two additional buttons: - One to store...
This is a discussion question for my csc 252 computer programming c++ visual studio so post...
This is a discussion question for my csc 252 computer programming c++ visual studio so post in c++ visual studio so that i can copy and paste thank you. In Object Oriented Programming, classes represent abstractions of real things in our programs. We must quickly learn how to define classes and develop skills in identifying appropriate properties and behaviors for our class. To this end, pick an item that you work with daily and turn it into a class definition....
Objectives: 1. To get familiar with C# programming language 2. To get familiar with Visual Studio...
Objectives: 1. To get familiar with C# programming language 2. To get familiar with Visual Studio development environment 3. To practice on writing a C# program Task 1: Create documentation for the following program which includes the following: a. Software Requirement Specification (SRS) b. Use Case Task 2: Write a syntactically and semantically correct C# program that models telephones. Your program has to be a C# Console Application. You will not implement classes in this program other than the class...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT