Question

C# program coding For undergraduate students in COP4983.703, the output in console of ass1.cs must display...

C# program coding

For undergraduate students in COP4983.703, the output in console of ass1.cs must display the following three lines of message:

Today is Monday, August 28, 2019

EXAM 1 is scheduled on Monday, October 07, 2019

There are 39.27 days before EXAM 1.

Homework Answers

Answer #1

C# CODE:

using System;

class MainClass {
    public static void Main (string[] args) {
        //Get current date
        DateTime todayDate = DateTime.Now;
        Console.WriteLine("Today is " + todayDate.ToString("dddd, dd MMMM yyyy"));
        //Set EXAM 1 date
        DateTime examDate = new DateTime(2019, 10, 07);
        Console.WriteLine("EXAM 1 is schedule on " + examDate.ToString("dddd, dd MMMM yyyy"));
        //Calculate number of days left in EXAM 1 from today's date
        double daysLeft = (examDate - todayDate).TotalDays;
        //Round off to 2 decimal places
        daysLeft = Math.Round(daysLeft, 2);
        Console.WriteLine("There are " + Convert.ToString(daysLeft) + " days before EXAM 1.");
    }
}

OUTPUT:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in Lab 2 to obtain a diameter value from the user and compute the volume of a sphere (we assumed that to be the shape of a balloon) in a new program, and implement the following restriction on the user’s input: the user should enter a value for the diameter which is at least 8 inches but not larger than 60 inches. Using an if-else...
Assignment #4 – Student Ranking : In this assignment you are going to write a program...
Assignment #4 – Student Ranking : In this assignment you are going to write a program that ask user number of students in a class and their names. Number of students are limited to 100 maximum. Then, it will ask for 3 test scores of each student. The program will calculate the average of test scores for each student and display with their names. Then, it will sort the averages in descending order and display the sorted list with students’...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
What role could the governance of ethics have played if it had been in existence in...
What role could the governance of ethics have played if it had been in existence in the organization? Assess the leadership of Enron from an ethical perspective. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies, collapsed in 2001 under a mountain of debt...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...