Next two letters at once


A university would like you to write a program to compute the fees charged on a student tuition bill. You will also write a test plan for this program.
Tuition is the same for all students, and is charged based on the number of credit hours enrolled in. The cost per credit hour is $465.
The school calculates student fees as a percentage of the total tuition being charged, unless the student is a non-degree seeking student.
The following rates will be used to compute the student fees:
Credit
Hours Non-degree
Seeking fee
(flat fee) Undergraduate
Rates
(% of tuition) Graduate
Rates
(% of tuition)
1-3 $100 3% 3%
4-9 2.8% 2.7%
10-14 2.5% 2.4%
15-18 2.2% 2.1%
Over 18 1.9% 1.9%
Credit
HoursNOTES:
1. All of the fixed values in the table should be stored as constants, using descriptive constant names. This means that you will need to create constants for the tuition cost, credit hour limits of each bracket, and the rates in each bracket.
2. The school should be able to modify any of the figures, simply by changing the constant values, and without having to modify any of the executable code.
3. Do not embed any constant values in the constant names!
Example:
const double RATE_OVER_18 = 0.019; // incorrect
This constant is defined incorrectly, because the credit hour limit of 18 is embedded in the constant name.
const int RATE4_HOUR_LIMIT = 18;
const double RATE5 = 0.019; // better!
In addition to the main function, you also will write a separate user-defined function that will use the chart above to determine the student fee percentage rate, based on student type and credit hours.
The user-defined function will:
_ Be given a descriptive name that describes what the function does
_ Take student type and number of credit hours as input arguments and will return a fee rate for use in the student fee calculations in the main function.
_ Use BOTH nested if statement(s) AND extended multi-way selection if statement(s) to determine the correct fee rate for the student.
NOTE: No switch statements shall be used in this program.
Program Implementation
The program should first describe its purpose.
Then prompt for and read the student type from the user.
NOTE: The program should work no matter whether the user enters the student type in either upper or lowercase.
If the student is an undergraduate or graduate student, the program should then prompt for and read in the number of credit hours the student is enrolled in.
Input Example 1
Notes on input:
1. You do not have to error check any of the user input -- you may assume all valid answers will be entered. But you must accept upper or lowercase for the student type.
2. If the student is non-degree seeking, the program should not prompt for credit hours.
Input Example 2
Student Fees Calculation Program
Student types choices:
U - undergraduate
G - graduate
N - non-degree seeking
Enter student type: G
Enter number of credit hours enrolled in: 10
Student Fees Calculation Program
Student types choices:
U - undergraduate
G - graduate
N - non-degree seeking
Enter student type: N
After reading all necessary input, use a decision statement to decide if the student is an undergraduate or graduate student. If so, the program will call the user-defined function to determine which fee rate to use.
The main function will use the returned fee rate to compute the student fee.
NOTE: If the student is non-degree seeking, the program should simply assign the flat fee for the student fee, without calling the user-defined function.
Finally, the program should neatly display the student type, credit hours (unless non-degree seeking), rate used (unless non-degree seeking), and the student fee, all lined up, right justified,as described and shown below.
NOTE: Use decision statements to decide what to output. Do not return from the middle of the main function, when the student is non-degree seeking.
Output Example 1
Notes on output:
1. The student type should be displayed in words (not just a character).
2. Rate used should be rounded to 1 decimal place.
3. Student fees are dollars and cents, and should be rounded to 2 decimal places.
Output Example 2
Testing
As part of your submission for this week, you must write a test plan for this program.
Your test plan must include both rationale for testing all conditions within the program and a list of the specific test cases. Each test case must include the exact user input used for the test and what the exact output expected.
Student Fees Summary
Student Type: Graduate
Credit Hours: 10
Rate Used: 2.4%
Student Fees: 111.60
Student Fees Summary
Student Type: Not degree seeking
Student Fees: 100.00
Testing
As part of your submission for this week, you must write a test plan for this program.
Your test plan must include both rationale for testing all conditions within the program and a list of the specific test cases. Each test case must include the exact user input used for the test and what the exact output expected.
Student Fees Summary
Student Type: Graduate
Credit Hours: 10
Rate Used: 2.4%
Student Fees: 111.60
Student Fees Summary
Student Type: Not degree seeking
Student Fees: 100.00
A test plan for last week's program 2 is included in the online Content as a sample (see
section 4.3.3).
The test plan should be contained in either a Word doc or an Excel spreadsheet.
NOTE: Although you are required to turn in a test plan for only this program, you will still be expected write your own test cases to test and validate the code of the other program, validating all possible logic paths.
Sample Plan Format
Rationale:
1. Test uppercase entry of student type
2. Test credit hours at lower boundary for bracket 10-14
:
Input Values
Tested
Output Expected

Program #2 
A partial electronic color code chart, used to indicate the ratings of electronic components, is 
shown below. 
Color Digit
Black 0
Brown 1
Red 2
Orange 3
Yellow 4
Green 5
Blue 6
Violet 7
Gray 8
White 9


You will write a program to identify the digit represented by a specific color code. 
The program should first describe its purpose. 
Then prompt the user for one letter (character) to identify the color. 
Use one large nested switch statement to output one of the following messages: 
• If the letter is 'R' or 'r', output: Red stands for digit 2. 
• If the letter is 'O' or 'o', output: Orange stands for digit 3. 
• If the letter is 'Y' or 'y', output: Yellow stands for digit 4. 
• If the letter is 'V' or 'v', output: Violet stands for digit 7. 
• If the letter is 'W' or 'w', output: White stands for digit 9. 
• If the letter is 'B' or 'b', prompt for the user for a second letter. 
o If the second letter is 'R' or 'r', output: Brown stands for digit 1. 
o If the second letter is 'L' or 'l', prompt for the third letter: 
If the third letter is 'A' or 'a', then output: Black stands for digit 0. 
If the third letter is 'U', or 'u', then output: Blue stands for digit 6. 
• If the letter is 'G' or 'g', prompt for the next two letters at once (note that you can still read them into two separate character variables). Be sure to verify the correctness of BOTH the second and third letters (not just the third letter!) 
o If the second letter is 'R' or 'r' 
and the third letter is 'A' or 'a', output: Gray stands for digit 8. 
and the third letter is 'E' or 'e', output: Green stands for digit 5. 
• If none of the above situations apply, output: Unknown Color 
The program should always produce an output message. Therefore, you need to insure that ALL possible input combinations produce output of either a correct color and digit, or the "Unknown Color" message. 
NOTES: 
The program should not require the user to enter any more letters than are necessary to determine the output. 
You are not allowed to use any if statements in this program. 
There will be no functions in this program, except for main. 

General Notes for BOTH programs: 

1) Program logic must be indented correctly. 

2) Comments must be included for any constant/variable whose name is not completely descriptive. 

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Next two letters at once
Reference No:- TGS085600

Expected delivery within 24 Hours