Question: In previous chapters, you continued to modify the MarshallsRevenue program. Now, modify the program so that the major functions appear in the following individual methods:

 In previous chapters, you continued to modify the MarshallsRevenue program. Now,

modify the program so that the major functions appear in the following

In previous chapters, you continued to modify the MarshallsRevenue program. Now, modify the program so that the major functions appear in the following individual methods:

GetMonth - This method prompts for and returns the month

GetNumMurals - This method prompts for and returns the number of murals scheduled and is called twice -- once for interior murals and once for exterior murals

ComputeRevenue - This method accepts the number of interior and exterior murals scheduled, accepts the month they are scheduled, displays the interior and exterior prices, and then returns the total expected revenue

DataEntry - This method fills an array with customer names and mural codes and is called twice -- once to fill the array of interior murals and once to fill the array of exterior murals

GetSelectedMurals - This method continuously prompts for mural codes and displays jobs of the corresponding type until a sentinel value is entered.

This is in C#, Please all the methods are works, Thanks

Previous code

using System; using static System.Console; class MarshallsRevenue { static void Main() { const int INTERIOR_PRICE = 500; const int DISCOUNT_INTERIOR_PRICE = 450; const int EXTERIOR_PRICE = 750; const int DISCOUNT_EXTERIOR_PRICE = 699; const int MIN_MURALS = 0; const int MAX_MURALS = 30; string entryString; int month; int numInterior; int numExterior; int revenueInterior; int revenueExterior; int total; bool isInteriorGreater; string[] interiorCustomers = new string[MAX_MURALS]; string[] exteriorCustomers = new string[MAX_MURALS]; char[] muralCodes = {'L', 'S', 'A', 'C', 'O'}; string[] muralCodesStrings = {"Landscape", "Seascape", "Abstract", "Children's", "Other"}; char[] interiorCodes = new char[MAX_MURALS]; char[] exteriorCodes = new char[MAX_MURALS]; int x; bool isValid; bool found; int pos = 0; int[] interiorCounts = {0, 0, 0, 0, 0}; int[] exteriorCounts = {0, 0, 0, 0, 0}; char option; const char QUIT = 'Z'; Write("Enter the month >> "); entryString = ReadLine(); month = Convert.ToInt32(entryString); while(month 12) { Write("Invalid month. Enter the month >> "); entryString = ReadLine(); month = Convert.ToInt32(entryString); } Write("Enter number of interior murals scheduled >> "); entryString = ReadLine(); numInterior = Convert.ToInt32(entryString); while(numInterior MAX_MURALS) { WriteLine("Number must be between {0} and {1} inclusive", MIN_MURALS, MAX_MURALS); Write("Enter number of interior murals scheduled >> "); entryString = ReadLine(); numInterior = Convert.ToInt32(entryString); } Write("Enter number of exterior murals scheduled >> "); entryString = ReadLine(); numExterior = Convert.ToInt32(entryString); while(numExterior MAX_MURALS) { WriteLine("Number must be between {0} and {1} inclusive", MIN_MURALS, MAX_MURALS); Write("Enter number of Exterior murals scheduled >> "); entryString = ReadLine(); numExterior = Convert.ToInt32(entryString); } if(month == 12 || month ==1 || month == 2) numExterior = 0; if(month == 4 || month == 5 || month ==9 || month ==10) revenueInterior = numInterior * DISCOUNT_INTERIOR_PRICE; else revenueInterior = numInterior * INTERIOR_PRICE; if(month == 7 || month == 8) revenueExterior = numExterior * DISCOUNT_EXTERIOR_PRICE; else revenueExterior = numExterior * EXTERIOR_PRICE; total = revenueInterior + revenueExterior; isInteriorGreater = numInterior > numExterior; WriteLine("{0} interior murals are scheuled at {1} each for a total of {2}", numInterior, INTERIOR_PRICE.ToString("C"), revenueInterior.ToString("C")); WriteLine("{0} exterior murals are scheuled at {1} each for a total of {2}", numExterior, EXTERIOR_PRICE.ToString("C"), revenueExterior.ToString("C")); WriteLine("Total revenue expected is {0}", total.ToString("C")); WriteLine("It is {0} that there are more interior murals scheduled than exterior ones.", isInteriorGreater);

WriteLine("Entering interior jobs:"); x = 0; while(x > "); interiorCustomers[x] = ReadLine(); WriteLine("Mural options are:"); for(int y = 0; y > "); interiorCodes[x] = Convert.ToChar(ReadLine()); isValid = false; while(!isValid) { for(int z = 0; z > "); interiorCodes[x] = Convert.ToChar(ReadLine()); } } ++x; } WriteLine("Entering exterior jobs:"); x = 0; while(x > "); exteriorCustomers[x] = ReadLine(); WriteLine("Mural options are:"); for(int y = 0; y > "); exteriorCodes[x] = Convert.ToChar(ReadLine()); isValid = false; while(!isValid) { for(int z = 0; z > "); interiorCodes[x] = Convert.ToChar(ReadLine()); } } ++x; } WriteLine(" The interior murals scheduled are:"); for(x = 0; x > ", QUIT); option = Convert.ToChar(ReadLine()); while(option != QUIT) { isValid = false; for(int z = 0; z

Write(" Enter a mural type or {0} to quit >> ", QUIT); option = Convert.ToChar(ReadLine()); } } }

Instructions MarshallsReve...+ 5 static void Main() In previous chapters, you continued to modify the MarshallsRevenue program. Now, modify the program so that the major functions appear in the following individual methods: // Write your main here. 7 8 9 10 public static int GetMonth() .GetMonth This method prompts for and // Write your GetMonth() nethod here. 12 13 14 15 16 17 returns the month public static int GetNumMurals (string location) GetNuMurals This method prompts for and returns the number of murals scheduled and is called twice - once for interior murals and once for exterior murals // Write your GetNumMurals( method here public static int ComputeRevenue(int month, int numInterior, int numExterior) ComputeRevenue This method accepts the number of interior and exterior murals scheduled, accepts the month they are scheduled, displays the interior and exterior prices, and then returns the total expected revenue 18 19 20 21 // Write your ComputeRevenue) method here. public static void DataEntry(string location, int num, string[] custoners, char[] muralcodes, string[] muralcodesStrings, char[] codes, int[1 counts) // Write your DataEntry() method here 23 24 25 DataEntry - This method fills an array with customer names and mural codes and is called twice- - once to fill the array of interior murals and once to fill the array of exterior murals public static void GetselectedMurals (char[] muralcodes, string[] muralcodesstrings, int numInterior, int numExterior, string[] interiorCustoners, char] interiorCodes, string[] exteriorCustoners, char exteriorCodes) 26 . GetSelectedMurals This method 27 // Write your GetSelectedMurals() method here continuously prompts for mural codes and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!