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...
Complete this programming problem in this assignment by using Microsoft Visual Studio Suite. Compile your solutions...
Complete this programming problem 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...
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...
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...
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...
How to compile this code on Visual Studio? Because it keeps getting me an error when...
How to compile this code on Visual Studio? Because it keeps getting me an error when i compile it. #include<iostream.h> #include<cio.h> class Array { public: Array(int=0)//initalise the array with 0 value Array(const Array &); ~Array(); private: int size; int *arr; bool setvalue(int index,int value); bool getvalue(int index,int &value); Array & increment(); int getsize(); void print(); Array &Add(const Array arr); bool Equal(const Array *arr)const; Array &removeAt(int index); Array &insertAt(int index,int value); }; //End of Array class void Array::setvalue(int index,int value) //set...
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...
WE ARE USING PYTHON TO COMPLETE THIS ASSIGNMENT :) THANK YOU! In this programming assignment, you...
WE ARE USING PYTHON TO COMPLETE THIS ASSIGNMENT :) THANK YOU! In this programming assignment, you will write functions to encrypt and decrypt messages using simple substitution ciphers. Your solution MUST include: a function called encode that takes two parameters: key, a 26-character long string that identifies the ciphertext mapping for each letter of the alphabet, in order; plaintext, a string of unspecified length that represents the message to be encoded. encode will return a string representing the ciphertext. a...
Please do this in visual studio C++. Overview In this programming challenge, you will create an...
Please do this in visual studio C++. Overview In this programming challenge, you will create an Employee Tree application. Instructions Begin this assignment by writing your own version of a class template that will create a binary tree that can hold values of any data type. Design an EmployeeInfo class that holds the following employee information: Employee ID Number (int) Employee Name (string) Next, use the template you designed to implement a binary tree whose nodes hold an instance of...
Programming with Microsoft Visual Basic 2017: Discuss the ORDER BY clause in the SELECT statement and...
Programming with Microsoft Visual Basic 2017: Discuss the ORDER BY clause in the SELECT statement and how that can help simplify the data retrieved by the query.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT