using System; using System.Numerics; using System.Globalization; using static System.Console; /* Author: Somxai Sirisack * Date Modified: 09/24/2023
Fantastic news! We've Found the answer you've been seeking!
Question:
using System; using System.Numerics; using System.Globalization; using static System.Console; /* Author: Somxai Sirisack * Date Modified: 09/24/2023 * Description: modification of MarshallRevenueDecision that the user must enter a month value from 1 through 12. I * f the user enters an incorrect number, the program prompts for a valid value. Also, the user must enter a number * between 0 and 30 inclusive for the number of murals of each type; otherwise, the program prompts the user again. * */ //assign each number to month inside a enumeration enum MONTHS { January = 1, February = 2, March = 3, April = 4, May = 5, June = 6, July = 7, August = 8, September = 9, October = 10, November = 11, December = 12 } class MarshallsRevenue { static void Main() { //create a constant variable for the cost of Interior and Exterior const int DiscountInteriorCost = 450; const int InteriorCost = 500; const int DiscountExteriorCost = 699; const int ExteriorCost = 750; //declare variable int InteriorNum, ExteriorNum; int TotalInterior, TotalExterior, Revenue; int monthNum; Write("Please type in the number of Interior murals scheduled to be " + "painted: "); InteriorNum = Convert.ToInt32(ReadLine()); //convert user input to int WriteLine(); while (InteriorNum < 0 || InteriorNum > 30) //while-loop to check if the user input the number between 0-30 { Write("Invalid value, please enter a number between 0-30: "); InteriorNum = Convert.ToInt32(ReadLine()); WriteLine(); } Write("Please type in the number of Exterior murals scheduled to be " + "painted: "); ExteriorNum = Convert.ToInt32(ReadLine()); //convert user input to int WriteLine(); while (ExteriorNum < 0 || ExteriorNum > 30) //while-loop to check if the user input the number between 0-30 { Write("Invalid value, please enter a number between 0-30: "); ExteriorNum = Convert.ToInt32(ReadLine()); WriteLine(); } Write("Enter a numeric value for the month being scheduled: "); //read user input for month monthNum = Convert.ToInt32(ReadLine()); WriteLine(); while (monthNum < 1 || monthNum > 12) //while-loop to check if user input the right numeric for months { Write("Invalid numeric month, please input valid numeric month: "); monthNum = Convert.ToInt32(ReadLine()); WriteLine(); } MONTHS MonthCalled = (MONTHS)monthNum; //calling month inside the enum TotalExterior = 0; TotalInterior = 0; /* * if-else statement for exterior mural */ if ((int)MonthCalled == 12 || (int)MonthCalled == 1 || (int)MonthCalled == 2) { WriteLine("Because of uncertain weather conditions, exterior murals cannot be painted in December through February. \n"); } if ((int)MonthCalled == 4 || (int)MonthCalled == 5 || (int)MonthCalled == 9 || (int)MonthCalled == 10) { TotalExterior += ExteriorNum * DiscountExteriorCost; } else if ((int)MonthCalled == 3 || (int)MonthCalled == 6 || (int)MonthCalled == 7 || (int)MonthCalled == 8 || (int)MonthCalled == 11) { TotalExterior += ExteriorNum * ExteriorCost; } /* *if-else statement for interior mural */ if ((int)MonthCalled == 7 || (int)MonthCalled == 8) { TotalInterior += InteriorNum * DiscountInteriorCost; } else if ((int)MonthCalled <= 12) { TotalInterior += InteriorNum * InteriorCost; } //calculate the total revenue Revenue = TotalExterior + TotalInterior; WriteLine("Total interior cost: {0}.", TotalInterior.ToString("C")); WriteLine("Total exterior cost: {0}.\n", TotalExterior.ToString("C")); WriteLine("The expected total revenue is {0}.\n", Revenue.ToString("C")); if (ExteriorNum < InteriorNum) { WriteLine("Interior murals are scheduled more than exterior murals."); } } //end of Main } //end of MarshallsRevenueLoop
!PLEASE MODIFY IT AS SIMPLE AS YOU CAN SO I CAN EASILY UNDERSTAND IT. I ASKED THIS QUESTION ONCE BUT THE CODING KINDA LOOK TOO ADVANCE AND I'M NOT AT THAT LEVEL YET. THANK YOU SO MUVH
Related Book For
Modern Database Management
ISBN: 978-0133544619
12th edition
Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi
Posted Date: