Question: This assignment is for the program c#: In this assignment you will have the following objectives: a. Create a ReadLine in the Main method to
This assignment is for the program c#:
In this assignment you will have the following objectives:
a. Create a ReadLine in the Main method to accept input from the user.
b. Create multiple functions that will solve the problem. All functionality to solve the problem should be contained in these methods as described below.
c. Final output must be in the Main method.
How you solve the problem is not as important as finding a way to do it, so do not feel limited in what youre allowed to do. The only limitation is that you cannot go outside the scope of this course; that is, you cannot use anything outside the scope of this class to solve the problem.
Your code should give the user meaningful output. So, after your calculations are complete, your code should report back to the user the final values with a Console.WriteLine().
This should contain the variables that you calculated and a concatenation text string that describes the value. e.g. Console.WriteLine(The area of the rectangle is +calcArea+ !);
In this program you will be calculating the total cost of gasoline spent on multiple car trips. INSTRUCTIONS:
1. Welcome the user and explain the purpose of the program.
2. You will be asking the user for the number of trips they wish to take.
a. Validate and convert this prompt to make sure it the correct data type and store the converted value in a variable.
b. Send this number variable as an argument into a custom function GetMiles.
3. Create a custom function named GetMiles that take in the number of trips the user wants to take and will return and array of the miles for each trip.
a. Create an array that will hold the miles for each of the users trips. i. Remember this arrays size should depend on what the user types in.
b. Create a loop that will prompt the user for each trips mileage and store it in an array element.
c. The prompt should tell the user what trip that they should input the mileage for. d. You should validate and convert the users response for each trip.
e. Once you have the mileage of each trip stored in the array, return this array to the Main method.
4. Once you have the number array of mileages back in your Main Method create a 2nd custom function called TotalMiles
a. This function should accept the number array of mileages and return the sum of all of the mileage.
b. Inside of this function create a variable to hold the total sum of miles.
c. Create a loop that will cycle through each element in the array and add it to the sum of the miles. i. These elements should NOT be hard-coded. An array of any size should still work.
d. After you get the total sum of all of the miles, return this array to the Main.
5. Back in the Main method, make sure to catch the returned value of the total of the miles.
6. Now you will ask the user for 2 more pieces of information, making sure you validate and convert each one to a correct data type. a. Prompt the user for the mpg (miles per gallon) their car can get. b. Prompt the user for the cost of 1 gallon of gas.
Topic Excellent (100%) Good (75%) Fair (3096) Technical Naming Programming Fundamentals User Prompting & The submitted files follow the correct naming convention of Lastname Firstname_FinalProject User is prompted for all required User is prompted for all required variables and validation and conversion is done correctly variables and validation and There are major errors in 10% Validation conversion is done, but there are prompting the user or validation minor errors GetMiles function is setup correctly,GetMiles function is setup GetMiles Function accepts a number as a parameter correctly, accepts a number as a 20% l and returns a number array to the | parameter and returns a number Main. The method functions as array to the Main, but there are There are maior errors in the GetMiles function described in the instructions minor errors TotalMiles function is setp correctly accepts a number array as a parameter and returns a number variable to the Main. The method functions as described in the instructions TotalMiles function is setp correctly, accepts a number array as a parameter and returnsa number variable to the Main, but there are minor errors TotalMiles Function There are maior errors in the TotalMiles function. 20% | CostOfGas function is setup correctly, accepts 3 parameters and returns a decimal variable. The method functions as described in the instructions CostOfGas function is setup CostofGas correctly, accepts 3 parameters There are major errors in the 20% CostOfGas function. and returns a decimal variable, however there are minor errors Function Final Total is correct and formatted Final Total is correct but is not Final Result 20% Final result is missi corr formatted correctl Test values are present in a multi-lined comment at the end of each section, contain the required values to test and are all correct. Test Values
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
