I'm am a C++ Beginner. Im having trouble completing stage 2-3. Im having a nervous breakdown due to this assignment being due in the next day and half. Please help me.
lT-Mobile LTE 11:56 PM 33% Back Lab35pecs.pdfQZ CSE142 handout #10 CS 210 Lab 3 Program Specifications Checkpoint due 11:59PM Sat Jan 26, 2019 Lab due 11:59PM Tue Jan 29, 2019 Program Overview: Your program will ask the user for data about two college applicants. It will then determine who the better candidate is. You will get more practice with OOP by defining a CollegeApplicant class and a client program of that class named CollegeAdmissions. You will be submitting the following files for grading Contents CollegeApplicant.h contains the definition of the CollegeApplicant class. This class is responsible for inputting and storing all the data needed about a college applicant to determine their overall application score CollegeAdmissions.cpp contains the client program containing the main) function that utilizes the various features of the CollegeApplicant class. It controls how many CollegeApplicant objects it will create, and what it is going to do with them Your completed program will be capable of generating the following sample I/O session, and the sample I/O sessions shown in the Lab3IOsessions.txt file contained in the Lab3Files.zip folder posted with this assignment. Note: User input is shown here in strong (boldfaced) type for convenient identification only. Likewise line numbers are shown only for easy reference and are not part of the actual I/O session 01 Welcome to Admissions Applicant Comparison System 02 Information for applicant #1: 03 04 05 06 07 08 09 10 exam score 60.0 11 GPA score76.5 12 13 Information for applicant #2: Do you have (S)AT scores or (A)CT scores? s Fnotice lowercase input Enter MATH score between 200 and 800 450 Enter READING score between 200 and 800: 530 Enter WRITING score between 200 and 800: 490 max GPA? 4.0 overall GPA? 3.4 Transcript Multiplier? 0.9 Do you have (S)AT scores or (A) CT scores? A notice uppercase input Enter ENGLISH score between and 36: 25 Enter MATH score between and 36: 20 Enter READTNG score between 1 and 36: 18 Enter SCIENCE score between and 36: 15 max GPA? 4.0 overall GPA? 3.3 Transcript Multiplier? 0.95 15 17 20 21 22 exam score = 54.4 23 GPA score 78.4 24 25 First applicant overall score = 136.5 26 second applicant overall score = 132.8 27 The first applicant seems to be better T-Mobile LTE 11:56 PM 33% Back Lab35pec s.pdfQ [ New C++ Language Elements: You will use if and if/else selection control structures in conjunction with relational and logical operators to determine the best applicant. You will also get experience controlling stream output through the use of the setprecision and fixed I/O stream manipulators. You will learn how to abort a program in the face of unrecoverable errors using the exit) function from the
standard C++ library. You will get lots more practice writing and calling member functions Problem Statement: This is a simplified version of a program that might be used for admissions purposes. For each applicant, we prompt for the exam scores (either SAT or ACT), overall GPA, maximum GPA and a transcript multiplier. The exam information is turned into a normalized exam score between 0 and 100. The GPA information is also turned into a normalized GPA score between 0 and 100. These two scores are added together to get an overall score between 0 and 200. After obtaining data for each of two applicants, the program reports which applicant looks better or whether they look equal Notice that the program asks for each applicant whether to enter SAT scores or ACT scores. The user will indicate this by typing "A", "a", "S" or "s". Your program should respond appropriately to both uppercase and lowercase input. SAT scores are integers that vary between 200 and 800. ACT scores are integers that vary between 1 and 36. In the case of SAT scores, the user is prompted for SAT math, reading, and writing scores. In the case of ACT scores, the user is prompted for English math, reading and science scores. These scores are then turned into a real-valued normalized exam score between 0 and 100 using the following formulas: 2 math +reading writing 32.0 For SAT Scores, normalized exam score- English +2 mathreading science For ACT Scores, normalized exam score- In addition to computing the normalized exam score, we compute a normalized GPA score between 0 and 100 based on the applicant's overall GPA, the maximum GPA, and a transcript multiplier. All three of these are positive real values (i.e., they can have a decimal part). The transcript multiplier is a value between 0.8 and 1.0 that the admissions staff use to account for differences across students and across schools. For example, a student who takes more AP courses or a student who comes from a high school that is known to have tough grading standards will get a higher transcript multiplier. You should turn this into a normalized GPA score between 0 and 100 using the following formula overall GPA max GPA Normalized GPA score 100 transcript multipler At this point your program has two scores that vary from 0 to 100; one from test scores and one from GPA data. The overall score for the applicant is computed as the sum of these two numbers (normalized exam score +normalized GPA score). Because each of these numbers is between 0 and 100, the overall score for an applicant ranges from 0 to 200 Program Specifications: As indicated in the sample I/O session above, your program is to report the normalized exam and GPA scores, and the overall score for each applicant. These should be displayed rounded to one decimal place. (See 4.10.5 on page 130 and the IO_ManipulatorDemo.cpp program posted in the Lab3Files folder posted with this assignment.) T-Mobile LTE 11:56 PM 33% Back Lab35pecs.pdfQZ Colle licant More Member Functions Description -string ge tTestType This function produces the first indented line of I/O for an applicant. So this function is used to produce lines 3 and 14 of the lVO session. If the user does not enter S, s, A or a to indicate SAT or ACT scores, this function should display an appropriate error message and terminate program execution. This function does NOT change the value of any data members. The user's input is stored in a local variable If the user types a valid score type, this function should return that value to the calling function Notice that this is a private function. It can only be called by other member functions, not by client programs. Stage 1 Client: The CollegeAdmission.cpp file should contain a program that generates lines 1 and 2 of the sample l/O session, plus it is indirectly responsible for generating line 3 by declaring a CollegeApplicant object. This invokes the constructor, which calls the setApplicantData () function, which calls the getTestType() function! End Stage 1 (Lab 2 Checkpoint) Stage 2 Specifications: Add or improve member functions as described in the modified UML class diagram below CollegeApplicant Member Functions Description tvoid setApplicantData () After getting the value for testType this function now gets the values for the math, reading and writing SAT scores, or the English, math, reading and science scores on the ACT test--whichever is appropriate. This should be done by repeatedly calling the getValidScore( member function described next. What will you pass for parameter values when you call the function? -int getValidScore (string prompt, This private member function will display the single int minScore int maxScore) indented prompt shown here Enter score between and : Of course eachis replaced by the appropriate parameter value. The user will then input a value in response to the prompt. If they don't type a valid score between minScore and maxScore an appropriate error message should be displayed and the program terminated If a valid score is entered it should be returned to the calling function l T-Mobile LTE 11:57 PM 33% Back Lab35pecs.pdfQ pecs.pdf Q Stage 2 Client: The CollegeAdmission.cpp file should now contain code to implement the following algorithm: 1. Display lines 1 and 2 of the sample I/O session 2. Declare a CollegeApplicant object for the first applicant. a. This will invoke the constructor, which will call setApplicantData) i. setApplicantData) will call getTestType ). ii. Based on the value returned by getTestType , setApplicantData) will call getValidScore ) several times appropriately 3. Display lines 12 and 13 of the sample I/O session 4. Declare a CollegeApplicant object for the second applicant. a. This will invoke the constructor, which will call setApplicantData(), which will in turn perform tasks i and ii as summarized above End Stage 2 Stage 3 Specifications: Add or improve member functions as described in the modified UML class diagram below CollegeApplicant Member Functions (Behaviors) Description After getting the value for testType and the relevant exam scores, prompt the user appropriately for the max GPA, overall GPA and transcript multiplier, and allow them to type a response as shown on lines 7-9 and 19-21 tvoid setApplicantData ) Display an appropriate error message and terminate the program if the overall GPA is negative or greater than the max GPA, or if the multiplier isn't between .8 and 1 This function calculates and returns the normalized exam score based on the SAT or ACT scores of the CollegeApplicant object. +double normalizedExamScore () This function calculates and returns the normalized GPA based on the max GPA, overall GPA and transcript multiplier of the CollegeApplicant object. +double normalizedGPA () This public function calculates and returns the overall score based on the normalized exam score and normalized GPA. This function should perform its job by calling the normalizedExamScore () and normalizedGPA ) functions appropriately. Choose appropriate return type, name and parameter list for this function ? ?? You choose T-Mobile LTE 11:56 PM 33% Back Lab3Specs.pdf Q In addition to reporting the overall score for each applicant, the program should also produce whichever of the following messages is appropriate The first applicant seems to be better . The second applicant seems to be better .The two applicants seem to be equal Knowing only what we know about C++ right now, there is no way for us to force the user to enter valid input. If the user provides invalid values, all calculations based on those values will be meaningless. So in this program, if the user inputs invalid data your program will immediately do the following 1. Display an appropriate error message telling them the program is about to terminate 2. Invoke the exit (EXITFAILURE) function from the C++ standard library which - will cause the program to immediately abort execution. We will learn alternate strategies for dealing with errors as the quarter progresses (The StringCompare_ExitDemo.cpp program posted in the Lab3Files folder posted with this assignment demonstrates the use of the exit (EXIT FAILURE) function.) The specifications for this lab will be presented in stages. DO NOT PROCEED TO LATER STAGES UNTIL EARLIER STAGES ARE COMPLETE Stage 1 (Checkpoint) Specifications: Define a CollegeApplicant class in a file named CollegeApplicant.h that implements the modified version of a UML diagram shown below Notice that this UML class diagram displays data items and function headers using C++ syntax instead of UML syntax. CollegeApplicant Data Members Description Will hold "S", "S", "A" or a" to indicate if applicant has SAT or ACT types of scores -string typeTest Eight (8) more private data members of the correct data type to store the math, reading, writing, English, and science scores as shown in sample I/O above. Also need private data members to hold the maximum GPA, overall ??? you choose DO NOT DECLARE ANY OTHER DATA MEMBERS THAN THOSE DESCRIBED HERE GPA and transcript multiplier. Your current options for IN STAGE 1 data types are int, double and string. Choose appropriate, self-documenting Camel-case variable names Member Functions Description constructor Constructor has empty parameter list and calls the setApplicantData function described next. This function will eventually be responsible for generating the indented lines 3-9 and 14-21 of the sample lO session shown above. For the checkpoint it should simply assign the typeTest data member the value returned by the getTestType() function described next tvoid setApplicantData ) T-Mobile LTE 11:57 PM 33%(10, Back Lab3Specs.pdf Q appropriate return type, name and parameter list for this function. Stage 3 Client: The CollegeAdmission. cpp file should now contain code that can generate the entire sample IVO session. The algorithm for the client now looks like the following: 1. Display lines 1 and 2 of the sample O session. 2. Declare a CollegeApplicant object for the first applicant 3. Display lines 10 and 11 of the lVO session by calling the normalized function appropriately. HINT: You will want to store the returned values in variables declared locally in maino 4. Display lines 12 and 13 of the sample WO session. 5. Declare a CollegeApplicant object for the first applicant 6. Display lines 22-24 of the lO session in the same way as step 3. 7. Display lines 25-27 HINT: Call the "You choose" member function that your wrote appropriately Implementation Requirements: You may not add any data members to the class after Stage 1. If you need other variables to hold data, declare them locally inside the member function that needs them. You may not declare additional public member functions not described in stages 1 through 3, but you may declare private member functions that can be called by the public member functions Style Specifications: Be sure your program adheres to the style specifications posted in the Quick Links and Assignment 3 modules on Canvas. Dashboard Calendar To Do Notifications Inbox lT-Mobile LTE 11:56 PM 33% Back Lab35pecs.pdfQZ CSE142 handout #10 CS 210 Lab 3 Program Specifications Checkpoint due 11:59PM Sat Jan 26, 2019 Lab due 11:59PM Tue Jan 29, 2019 Program Overview: Your program will ask the user for data about two college applicants. It will then determine who the better candidate is. You will get more practice with OOP by defining a CollegeApplicant class and a client program of that class named CollegeAdmissions. You will be submitting the following files for grading Contents CollegeApplicant.h contains the definition of the CollegeApplicant class. This class is responsible for inputting and storing all the data needed about a college applicant to determine their overall application score CollegeAdmissions.cpp contains the client program containing the main) function that utilizes the various features of the CollegeApplicant class. It controls how many CollegeApplicant objects it will create, and what it is going to do with them Your completed program will be capable of generating the following sample I/O session, and the sample I/O sessions shown in the Lab3IOsessions.txt file contained in the Lab3Files.zip folder posted with this assignment. Note: User input is shown here in strong (boldfaced) type for convenient identification only. Likewise line numbers are shown only for easy reference and are not part of the actual I/O session 01 Welcome to Admissions Applicant Comparison System 02 Information for applicant #1: 03 04 05 06 07 08 09 10 exam score 60.0 11 GPA score76.5 12 13 Information for applicant #2: Do you have (S)AT scores or (A)CT scores? s Fnotice lowercase input Enter MATH score between 200 and 800 450 Enter READING score between 200 and 800: 530 Enter WRITING score between 200 and 800: 490 max GPA? 4.0 overall GPA? 3.4 Transcript Multiplier? 0.9 Do you have (S)AT scores or (A) CT scores? A notice uppercase input Enter ENGLISH score between and 36: 25 Enter MATH score between and 36: 20 Enter READTNG score between 1 and 36: 18 Enter SCIENCE score between and 36: 15 max GPA? 4.0 overall GPA? 3.3 Transcript Multiplier? 0.95 15 17 20 21 22 exam score = 54.4 23 GPA score 78.4 24 25 First applicant overall score = 136.5 26 second applicant overall score = 132.8 27 The first applicant seems to be better T-Mobile LTE 11:56 PM 33% Back Lab35pec s.pdfQ [ New C++ Language Elements: You will use if and if/else selection control structures in conjunction with relational and logical operators to determine the best applicant. You will also get experience controlling stream output through the use of the setprecision and fixed I/O stream manipulators. You will learn how to abort a program in the face of unrecoverable errors using the exit) function from the standard C++ library. You will get lots more practice writing and calling member functions Problem Statement: This is a simplified version of a program that might be used for admissions purposes. For each applicant, we prompt for the exam scores (either SAT or ACT), overall GPA, maximum GPA and a transcript multiplier. The exam information is turned into a normalized exam score between 0 and 100. The GPA information is also turned into a normalized GPA score between 0 and 100. These two scores are added together to get an overall score between 0 and 200. After obtaining data for each of two applicants, the program reports which applicant looks better or whether they look equal Notice that the program asks for each applicant whether to enter SAT scores or ACT scores. The user will indicate this by typing "A", "a", "S" or "s". Your program should respond appropriately to both uppercase and lowercase input. SAT scores are integers that vary between 200 and 800. ACT scores are integers that vary between 1 and 36. In the case of SAT scores, the user is prompted for SAT math, reading, and writing scores. In the case of ACT scores, the user is prompted for English math, reading and science scores. These scores are then turned into a real-valued normalized exam score between 0 and 100 using the following formulas: 2 math +reading writing 32.0 For SAT Scores, normalized exam score- English +2 mathreading science For ACT Scores, normalized exam score- In addition to computing the normalized exam score, we compute a normalized GPA score between 0 and 100 based on the applicant's overall GPA, the maximum GPA, and a transcript multiplier. All three of these are positive real values (i.e., they can have a decimal part). The transcript multiplier is a value between 0.8 and 1.0 that the admissions staff use to account for differences across students and across schools. For example, a student who takes more AP courses or a student who comes from a high school that is known to have tough grading standards will get a higher transcript multiplier. You should turn this into a normalized GPA score between 0 and 100 using the following formula overall GPA max GPA Normalized GPA score 100 transcript multipler At this point your program has two scores that vary from 0 to 100; one from test scores and one from GPA data. The overall score for the applicant is computed as the sum of these two numbers (normalized exam score +normalized GPA score). Because each of these numbers is between 0 and 100, the overall score for an applicant ranges from 0 to 200 Program Specifications: As indicated in the sample I/O session above, your program is to report the normalized exam and GPA scores, and the overall score for each applicant. These should be displayed rounded to one decimal place. (See 4.10.5 on page 130 and the IO_ManipulatorDemo.cpp program posted in the Lab3Files folder posted with this assignment.) T-Mobile LTE 11:56 PM 33% Back Lab35pecs.pdfQZ Colle licant More Member Functions Description -string ge tTestType This function produces the first indented line of I/O for an applicant. So this function is used to produce lines 3 and 14 of the lVO session. If the user does not enter S, s, A or a to indicate SAT or ACT scores, this function should display an appropriate error message and terminate program execution. This function does NOT change the value of any data members. The user's input is stored in a local variable If the user types a valid score type, this function should return that value to the calling function Notice that this is a private function. It can only be called by other member functions, not by client programs. Stage 1 Client: The CollegeAdmission.cpp file should contain a program that generates lines 1 and 2 of the sample l/O session, plus it is indirectly responsible for generating line 3 by declaring a CollegeApplicant object. This invokes the constructor, which calls the setApplicantData () function, which calls the getTestType() function! End Stage 1 (Lab 2 Checkpoint) Stage 2 Specifications: Add or improve member functions as described in the modified UML class diagram below CollegeApplicant Member Functions Description tvoid setApplicantData () After getting the value for testType this function now gets the values for the math, reading and writing SAT scores, or the English, math, reading and science scores on the ACT test--whichever is appropriate. This should be done by repeatedly calling the getValidScore( member function described next. What will you pass for parameter values when you call the function? -int getValidScore (string prompt, This private member function will display the single int minScore int maxScore) indented prompt shown here Enter score between and : Of course eachis replaced by the appropriate parameter value. The user will then input a value in response to the prompt. If they don't type a valid score between minScore and maxScore an appropriate error message should be displayed and the program terminated If a valid score is entered it should be returned to the calling function l T-Mobile LTE 11:57 PM 33% Back Lab35pecs.pdfQ pecs.pdf Q Stage 2 Client: The CollegeAdmission.cpp file should now contain code to implement the following algorithm: 1. Display lines 1 and 2 of the sample I/O session 2. Declare a CollegeApplicant object for the first applicant. a. This will invoke the constructor, which will call setApplicantData) i. setApplicantData) will call getTestType ). ii. Based on the value returned by getTestType , setApplicantData) will call getValidScore ) several times appropriately 3. Display lines 12 and 13 of the sample I/O session 4. Declare a CollegeApplicant object for the second applicant. a. This will invoke the constructor, which will call setApplicantData(), which will in turn perform tasks i and ii as summarized above End Stage 2 Stage 3 Specifications: Add or improve member functions as described in the modified UML class diagram below CollegeApplicant Member Functions (Behaviors) Description After getting the value for testType and the relevant exam scores, prompt the user appropriately for the max GPA, overall GPA and transcript multiplier, and allow them to type a response as shown on lines 7-9 and 19-21 tvoid setApplicantData ) Display an appropriate error message and terminate the program if the overall GPA is negative or greater than the max GPA, or if the multiplier isn't between .8 and 1 This function calculates and returns the normalized exam score based on the SAT or ACT scores of the CollegeApplicant object. +double normalizedExamScore () This function calculates and returns the normalized GPA based on the max GPA, overall GPA and transcript multiplier of the CollegeApplicant object. +double normalizedGPA () This public function calculates and returns the overall score based on the normalized exam score and normalized GPA. This function should perform its job by calling the normalizedExamScore () and normalizedGPA ) functions appropriately. Choose appropriate return type, name and parameter list for this function ? ?? You choose T-Mobile LTE 11:56 PM 33% Back Lab3Specs.pdf Q In addition to reporting the overall score for each applicant, the program should also produce whichever of the following messages is appropriate The first applicant seems to be better . The second applicant seems to be better .The two applicants seem to be equal Knowing only what we know about C++ right now, there is no way for us to force the user to enter valid input. If the user provides invalid values, all calculations based on those values will be meaningless. So in this program, if the user inputs invalid data your program will immediately do the following 1. Display an appropriate error message telling them the program is about to terminate 2. Invoke the exit (EXITFAILURE) function from the C++ standard library which - will cause the program to immediately abort execution. We will learn alternate strategies for dealing with errors as the quarter progresses (The StringCompare_ExitDemo.cpp program posted in the Lab3Files folder posted with this assignment demonstrates the use of the exit (EXIT FAILURE) function.) The specifications for this lab will be presented in stages. DO NOT PROCEED TO LATER STAGES UNTIL EARLIER STAGES ARE COMPLETE Stage 1 (Checkpoint) Specifications: Define a CollegeApplicant class in a file named CollegeApplicant.h that implements the modified version of a UML diagram shown below Notice that this UML class diagram displays data items and function headers using C++ syntax instead of UML syntax. CollegeApplicant Data Members Description Will hold "S", "S", "A" or a" to indicate if applicant has SAT or ACT types of scores -string typeTest Eight (8) more private data members of the correct data type to store the math, reading, writing, English, and science scores as shown in sample I/O above. Also need private data members to hold the maximum GPA, overall ??? you choose DO NOT DECLARE ANY OTHER DATA MEMBERS THAN THOSE DESCRIBED HERE GPA and transcript multiplier. Your current options for IN STAGE 1 data types are int, double and string. Choose appropriate, self-documenting Camel-case variable names Member Functions Description constructor Constructor has empty parameter list and calls the setApplicantData function described next. This function will eventually be responsible for generating the indented lines 3-9 and 14-21 of the sample lO session shown above. For the checkpoint it should simply assign the typeTest data member the value returned by the getTestType() function described next tvoid setApplicantData ) T-Mobile LTE 11:57 PM 33%(10, Back Lab3Specs.pdf Q appropriate return type, name and parameter list for this function. Stage 3 Client: The CollegeAdmission. cpp file should now contain code that can generate the entire sample IVO session. The algorithm for the client now looks like the following: 1. Display lines 1 and 2 of the sample O session. 2. Declare a CollegeApplicant object for the first applicant 3. Display lines 10 and 11 of the lVO session by calling the normalized function appropriately. HINT: You will want to store the returned values in variables declared locally in maino 4. Display lines 12 and 13 of the sample WO session. 5. Declare a CollegeApplicant object for the first applicant 6. Display lines 22-24 of the lO session in the same way as step 3. 7. Display lines 25-27 HINT: Call the "You choose" member function that your wrote appropriately Implementation Requirements: You may not add any data members to the class after Stage 1. If you need other variables to hold data, declare them locally inside the member function that needs them. You may not declare additional public member functions not described in stages 1 through 3, but you may declare private member functions that can be called by the public member functions Style Specifications: Be sure your program adheres to the style specifications posted in the Quick Links and Assignment 3 modules on Canvas. Dashboard Calendar To Do Notifications Inbox