Question

In: Computer Science

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 1: Today is Monday Days to the meeting is 10 days Meeting day is Thursday

Solutions

Expert Solution

SOURCE CODE:

*Please follow the comments to better understand the code.

**Please look at the Screenshot below and use this code to copy-paste.

***The code in the below screenshot is neatly indented for better understanding.

using System;

public class GFG{
// function to convert number to string weekday
static string getDayStr(int day)
{
string dayStr;
   switch(day)
   {
   case 0:
   dayStr="Sunday";
   break;
   case 1:
   dayStr="Monday";
   break;
   case 2:
   dayStr="Tuesday";
   break;
   case 3:
   dayStr="Wednesday";
   break;
   case 4:
   dayStr="Thursday";
   break;
   case 5:
   dayStr="Friday";
   break;
   case 6:
   dayStr="Saturday";
   break;
   default:
   dayStr="-1";
   break;
  
   }
   return dayStr;
}
// test the program
   static public void Main ()
   {
   // read data
   int today = Convert.ToInt32(Console.ReadLine());
   int next = Convert.ToInt32(Console.ReadLine());
  
   // is it valid??
   if(today>6 || today<0)
       Console.WriteLine("Invalid day");
       else
       {
       // calculate next weekday
       int nextDay=(next+today)%7;
       // write the output
   Console.WriteLine("Today is "+getDayStr(today));
   Console.WriteLine("Days to meeting is "+(next));
   Console.WriteLine("Meeting day is "+getDayStr(nextDay));
  
       }
   }
}

========

SCREENSHOT:

OUTPUTS:


Related Solutions

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...
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.
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...
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.
DO THIS IN C#. Design and implement a program (name it MinMaxAvg) that defines three methods...
DO THIS IN C#. Design and implement a program (name it MinMaxAvg) that defines three methods as follows: Method max (int x, int y, int z) returns the maximum value of three integer values. Method min (int X, int y, int z) returns the minimum value of three integer values. Method average (int x, int y, int z) returns the average of three integer values. In the main method, test all three methods with different input value read from the...
C programming - Implement a dynamic array, please read and implement the dynarray.c file with what...
C programming - Implement a dynamic array, please read and implement the dynarray.c file with what is given dynarray.h /* * This file contains the definition of the interface for the dynamic array * you'll implement. You can find descriptions of the dynamic array functions, * including their parameters and their return values, in dynarray.c. You * should not modify anything in this file. */ #ifndef __DYNARRAY_H #define __DYNARRAY_H /* * Structure used to represent a dynamic array. */ struct...
Implement a queue - C programming, please read the instruction carefully and implement queue.c using dynamic...
Implement a queue - C programming, please read the instruction carefully and implement queue.c using dynamic array structure given dynarray.h and dynarray.c below The second ADT you'll implement for this assignment is a queue. For this assignment, the interface for the queue (i.e. the structures and the prototypes of functions a user of the queue interacts with) is already defined for you in the file queue.h. Your first task in this assignment is to implement definitions for the functions that...
In C++ Design and implement a program (name it ProcessGrades) that reads from the user four...
In C++ Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT