Question

In: Computer Science

I need this in C# please. Exercise #2: Design and implement a programming (name it NextMeeting)...

I need this in C# please.

Exercise #2: Design and implement a programming (name it NextMeeting) to determine the day of your next meeting from today. The program reads from the user an integer value representing today’s day (assume 0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, etc…) and another integer value representing the number of days to the meeting day. The program determines and prints out the meeting day. Format the outputs following the sample runs below.

Sample run 1:

Today is Monday

Days to the meeting is 10 days

Meeting day is Thursday

Sample run 2:

Today is Wednesday

Days to the meeting is 7 days

Meeting day is Wednesday

Sample run 3:

Today is Friday

Days to the meeting is 20 days

Meeting day is Thursday

Solutions

Expert Solution

using System;

namespace ConsoleApplication1
{
class NextMeeting
{
static void Main(string[] args)
{
// string array for days of week
string[] days = { "Sunday","Monday", "Tuesday","Wednesday","Thursday","Friday","Saturday" };
int today, meetingDay;

// ASk user to enter today and meeting day
Console.Write("Enter today's day [assume 0 for Sunday, 1 for Monday..]: ");
today = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter number of days to the meeting day: ");
meetingDay = Convert.ToInt32(Console.ReadLine());

// Calculate result day, if it's value is >=7, round it
int result = today + meetingDay;
if (result >= 7)
{
result = result % 7;
}

// Get day of week and print the result
string meetingDayOfWeek = days[result];
Console.WriteLine("\nToday is "+days[today]);
Console.WriteLine("Days to the meeting is "+meetingDay+" days.");
Console.WriteLine("Meeting day is "+meetingDayOfWeek);
}
}
}

OUTPUT


Related Solutions

I need this in C# with pseudocode Exercise #2: Design and implement a programming (name it...
I need this in C# with pseudocode Exercise #2: Design and implement a programming (name it EvenOdd) that uses a while loop to determine and print out all even numbers between 50 and 100 on a single line, separated by commas. Then another while loop in the same program to print out all odd numbers between 50 and 100 on a new line, separated by commas. Document your code and properly label the outputs as shown below. Even numbers between...
PLEASE DO THIS IN C#Design and implement a programming (name it NextMeeting) to determine the day...
PLEASE DO THIS IN C#Design and implement a programming (name it NextMeeting) to determine the day of your next meeting from today. The program reads from the user an integer value representing today’s day (assume 0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, etc…) and another integer value representing the number of days to the meeting day. The program determines and prints out the meeting day. Format the outputs following the sample runs below. Sample run...
IN C++ PLEASE!!! Design and implement a programming (name it SimpleMath) that reads two floating-point numbers...
IN C++ PLEASE!!! Design and implement a programming (name it SimpleMath) that reads two floating-point numbers (say R and T) and prints out their values, sum, difference, and product on separate lines with proper labels.
IN C++ PLEASE!!! Design and implement a program (name it Coins) that determines the values of...
IN C++ PLEASE!!! Design and implement a program (name it Coins) that determines the values of coins in a jar. The program prints out the total dollars and cents in the jar. The program prompts the user to enter the number of coins (quarters, dimes, nickels, and pennies). Print out the number of coins entered for each coin type on separate lines followed by the total amount of money in the jar as dollars and cents as shown below.
In c++   Design and implement a programming (name it SimpleMath) that reads two floating-point numbers (say...
In c++   Design and implement a programming (name it SimpleMath) that reads two floating-point numbers (say R and T) and prints out their values, sum, difference, and product on separate lines with proper labels. Comment your code properly and format the outputs following these sample runs.
IN C++ LANGUAGE PLEASE::: Design and implement a program (name it Rectangle) to calculate and display...
IN C++ LANGUAGE PLEASE::: Design and implement a program (name it Rectangle) to calculate and display the area and perimeter of a rectangle with width = 4 and height = 8.
C++ Programming: Programming Design and Data Structures Chapter 13 Ex 2 Redo Programming Exercise 1 by...
C++ Programming: Programming Design and Data Structures Chapter 13 Ex 2 Redo Programming Exercise 1 by overloading the operators as nonmembers of the class rectangleType. The header and implementation file from Exercise 1 have been provided. Write a test program that tests various operations on the class rectangleType. I need a main.cpp file Given: **************rectangleType.cpp******************** #include <iostream> #include <cassert> #include "rectangleType.h" using namespace std; void rectangleType::setDimension(double l, double w) { if (l >= 0) length = l; else length =...
I need to implement the gates on Logism, please clearly explain all steps. Part A: Design...
I need to implement the gates on Logism, please clearly explain all steps. Part A: Design and wire a circuit to implement the Boolean expression S (x, y, z) = ∑m (1, 2, 4, 7) usingan 8-to-1 multiplexer . Verify the operation by checking all input combinations in the Boolean function's truth table. Part B: Implement the function S (x, y, z) from Part A using only a 4-to-1 multiplexer .You may use NOT gates as needed. Part C: Implement...
Programming Exercise Implement the following class design: class Tune { private:    string title; public:   ...
Programming Exercise Implement the following class design: class Tune { private:    string title; public:    Tune();    Tune( const string &n );      const string & get_title() const; }; class Music_collection { private: int number; // the number of tunes actually in the collection int max; // the number of tunes the collection will ever be able to hold Tune *collection; // a dynamic array of Tunes: "Music_collection has-many Tunes" public: // default value of max is a conservative...
I need C++ programming with output. I have tried other programming and it does not work....
I need C++ programming with output. I have tried other programming and it does not work. So please give me the one that actually works. Assignment 1 Design your own linked list class that works as a template class. It should provide member functions for appending, inserting and deleting nodes. The destructor should destroy the list. The class should also provide a member function that will display the contents of the list to the screen. The class should also provide...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT