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...
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...
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...
USE VISUAL STUDIO/VB In this assignment, you will create an array of ten elements, one for...
USE VISUAL STUDIO/VB In this assignment, you will create an array of ten elements, one for name, one for hours worked,and the last for hourly rate. The arrays will receive the information from inputs from the screen.For example, you will ask the following three questions: a) Employee name: b) Hours worked: c) Hourly rate: After you have received all ten records and have inserted them into the array, you will then calculate the hourly rate times the hours worked to...
Assignment: Complete the following problems. You must show your work on the math problems to get...
Assignment: Complete the following problems. You must show your work on the math problems to get full credit. Every student is responsible for completing their own responses to the following problems. 1. Eastern Engineering has the following base-case estimates for a new small engine assembly project:               Capital Investment = $15,000,000               Fixed Costs = $3,250,000               Variable Costs = $600 per unit               Price per Unit = $1,000               Demand = 20,000 units per year Service Life = 12...
Assignment Requirements Please complete all parts in a Microsoft Word document. The body of your document...
Assignment Requirements Please complete all parts in a Microsoft Word document. The body of your document should be at least 900 words in length. Quoting should be less than 10% of the entire paper. Paraphrasing is necessary. Students must cite and reference at least 4 credible sources from the Library. Instructions Imagine that you are an administrator for a large hospital. As part of your role within healthcare leadership, you are involved in several committees for the organization. For this...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT