EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C/C++代写
您的位置: 主页 > 编程案例 > C/C++代写 >
代写C++/C:CS作业代写之C++ Write a C++ program to grade multiple-choice - C++代写
发布时间:2021-07-25 22:30:51浏览次数:
Problem DescriptionWrite a C++ program to grade multiple-choice, including True/False, questions for an exam given in a class. A class may have one or more sections. The answer keys are the same for all sections of a class for one exam, but the number of students is normally different for different sections. Your program will be used for different classes and/or different exams, and the number of questions will be different. But any exam should have at least 1 and at most 40 questions. The answer key and a student s answer to a question could be a digit, between 1 and 5 (inclusive), or a character among A, B, C, D, E, F and T, or lower case equivalent.Input Data·The first value in the input file is the number of questions of the exam.·The second line is the answer keys without spaces between any two answers.·The next line is the number of sections, followed by data for all sections.·The data for a section begins with the number of students, followed by students data.·The data for each student is on a separate line, beginning with the answers from the student followed by the student s last name.·As the key answers, there is no space between any two answers.·The student s last name comes after his/her last answer without any spaces between.·Any student s last name has at most 15 characters.Sample input is given later.You can assume the input data are correct and do not check for invalid values.Output Data·For each student, last name, number of correct answers, and Pass or Fail. A student passes an exam if the number of correct answers is 70% or better of total number of questions, and fails otherwise.·For each section, the total number of students and the number of students who passed the exam.·For the entire class, the number of sections, the total number of students and the number of students who passed the exam.See sample output later for the exact output format.The following requirements must be followed:1.You mustNOTuse structs, 2D array or classes. You will lose 2 points if you do NOT adhere to this.2.You must use the following two functions in your program. You will lose 2 points for each of the functions that is not used in your program.3. 4. // The function reads in numQuestions answers into array answers.5. // Parameters: (out, in)6. void ReadAnswers(char answers[], int numQuestions);7. 8. // The function compares a student s answers against the answer 9. // keys and passes back the number of correct answers and 10. // whether the student passed the exam.11. // Parameters: (in, in, in, out, out)12. void ProcessAnswer(const char keys[], const char answers[], 13. int numQuestion, int correct, bool pass);14.15.You must also use the following two functions in your program. You should also provide the comment blocks for the function documentation. You will lose 2 points for each of the functions that is not used. You will lose 1 points for each missing documentation comment block.16.17.void UpdateTotal(int totalStudents, int totalPassed, 18. int numStudents, int Passed);19.void ProcessOneSection(int numStudents, int Passed, 20. int numQuestion, char Keys[]);21.You must use the same function ReadAnswers() to read the answer keys and the answers for each student. You will lose two points if different functions are used.22.You must usefor loopsto process all sections of the class, all students of a section, and all answers of a student. Nowhile loopsare allowed on this assignment. You will lose two points for each while loop used in your program.23.You must follow the programming ground rules.oAll functions, including the main function, should be no more than30lines long, from the left brace to the right brace, inclusive.oEach function should have a comment block before the function header, and each function parameter should be identified as in, out, or in/out parameter.oEach line, including comments, should be at most74columns long.oNo magic numbers! Some constant definitions are given below:o o const int MAX_QUESTIONS = 40;o const float PASS_PERCENT = 0.7;24.To get credit for the assignment, your solution must minimally work on test set 1 of your submission log. The input file of test1 is given to you.NotesYour main() function could be like the following: Read number of questions Read and store the answer keys Read number of sections For each section Process all students answers Update class results Display results for the section Display results for the entire class You can also use functiontoupper(x)to convert a character to upper case. You need to include header file ctype to use the function.Sample Input (Test set 1)10t2ft5Ttfft24T2Ft4ttftTHockneyt1fF5ffttfHillf3ft5fTTftLongwoodt4Tf5TFTFTSharp5T2Ft5ttffTHockneyt2ft4ttfFtHillf2ft4tTTftLongwoodt2Tf5FFTFTSharpt2fT5FFTtTQuickSample Output (Test set 1)The following output is generated in batch mode. Name Correct Answers PASS/FAIL Hockney 8 PASS Hill 3 FAIL Longwood 6 FAIL Sharp 5 FAIL1 out of 4 students of section 1 passed the exam. Name Correct Answers PASS/FAIL Hockney 10 PASS Hill 9 PASS Longwood 7 PASS Sharp 5 FAILQuick 6 FAIL3 out of 5 students of section 2 passed the exam.There are 10 questions in the exam. There are 2 sections, and 4 out of 9 students passed the exam.Since the HiC grader runs in interactive mode, the output will look different:10t2ft5Ttfft2 Name Correct Answers PASS/FAIL 4T2Ft4ttftTHockney Hockney 8 PASSt1fF5ffttfHill Hill 3 FAILf3ft5fTTftLongwood Longwood 6 FAILt4Tf5TFTFTSharp Sharp 5 FAIL1 out of 4 students of section 1 passed the exam. Name Correct Answers PASS/FAIL 5T2Ft5ttffTHockney Hockney 10 PASSt2ft4ttfFtHill Hill 9 PASSf2ft4tTTftLongwood Longwood 7 PASSt2Tf5FFTFTSharp Sharp 5 FAILt2fT5FFTtTQuick Quick 6 FAIL3 out of 5 students of section 2 passed the exam.There are 10 questions in the exam. There are 2 sections, and 4 out of 9 students passed the exam.When you test your program, please make sure your output matches the interacive mode output if you are using HiC.CS303 Program 5Program DescriptionYou are going to write a computer program/prototype to process mail packages that are sent to different cities. For each destination city, a destination object is set up with the name of the city, the count of packages to the city and the total weight of all the packages. The destination object is updated periodically when new packages are collected. You will maintain a list of destination objects and use commands to process data in the list.Commands DescriptionYou will read and process commands from the standard input, stopping when the Quit command is entered. Commands can have parameters. The commands you are to implement are of the form: Add city Output city Update city package_count package_weight Clear city Quit1.Add command: Add a destination object for the given city to the end of the list if a destination object for that city doesn t already exist and the list isn t full. If the list is full or a destination object for that city already exists, still read in the data; however, don t do anything with the data read in (toss it!), and print an error message (check the full condition first). Be sure to initialize the new destination object before adding it to the list.2.Output command: Output the average package weight of the destination object for the specified city. If the destination object for the given city doesn t exist, print an appropriate message. See the sample outputs below for the exact message.3.Update command: Update the destination object for the specified city by adding the given package_count and package_weight to the count and weight respectively. If the destination object doesn t exist, print an appropriate message.4.Clear command: Reset the count and weight of the destination object for the specified city to zero, but do not change the city name. If the destination object doesn t exist, print an appropriate message.5.Quit command: Terminate the program.You can assume all inputs are formatted correctly. In particular, you do not need to check for invalid commands.Requirements1.You must use the following declarations:const int MAX_CITIES = 5;const int NOT_FOUND = -1;// Write a comment block here that describes this class.class Destination{ string city; // the name of the city where packages are to be sent int package_count; // count of packages float total_weight; // total weight of all packages . . . // remove this comment and add properly-commented methods which are described below.};// Write a comment block here that describes this class.class DestinationList{ int num; // number of objects in the list Destination list[MAX_CITIES]; // array of destinations . . . // remove this comment and add properly-commented methods which are described below.};2.You cannot add other data members to this Destination class. Failure to comply will result in a zero (0). We suggest you copy/paste these into your program!3.You areonlyallowed to manipulate a Destination s data member via the following four methods and one constructor.These methods MUST be placed in the class Destination; 2 points off for each one not in the Destination class and 2 points off if NOT used.Do NOT forget to complete the “TODO” portions indicated below.You will lose points if you forget to finish these TODOs!// Thisconstructor initializes the city to name and // both the package count and total weight to 0.// params: TODODestination( string name )// Adds numPackages and packageWeight to the package count and total weight, respectively.// params: TODOvoid RecordShipment( int numPackages, float packageWeight ) // Returns true if the object s city is the same as name; false otherwise// params: TODObool DestinationHasName( string name ) // Zeroes the package count and total weight.void ClearShipment( ) // returns average weight of the packages in a shipment, or 0.0 if there// are no packagesfloatAverageWeight( )4.You must properly complete and comment these methods. None of these methods are allowed to print or read any data; if they do, you will lose 3 points for each violation.5.For theDestinationListclass, you must write a search function. The function must have one parameter: a string containing a city name. The function is to determine whether or not an object with the specified city name is in the list, returning the index of the city if it is found or a -1 if it is not. Failing to write and use this function will result in a 3-point penalty. Furthermore, the function cannot read or print data with a 2-point penalty if it does.For this DestinationList class, you should have a default constructor and public methods, to add, update and output information maintained by this class.6.Lastly, the main program should ONLY have 2 variables. One of those variables will be of type DestinationList and the other of type string to hold the command.-2 points for using more than 2 variables in main.7.Display all float values with 2 decimal digits. Use cout fixed showpoint setprecision(2);8.See the sample output for the exact wording of all messages.9.To get minimal credit for the assignment, your solution must work on both Test 1 and Test 2.10.Don t forget to follow the programming ground rules.11.You may work in teams for this assignment. If you choose to work in a team, you must sign up by Wednesday, Nov. 9th at 3 pm. If you choose this option, you must follow the other requirements given here:team-requirements.Note you will be required to work in teams for assignment 6.Sample Input (Test 1)Add MadisonAdd ChicagoUpdate Madison 2 60.75Update Chicago 4 180 Update Chicago 3 46.1 Output ChicagoOutput MadisonAdd DubuqueUpdate Dubuque 4 400Clear ChicagoOutput ChicagoUpdate Dubuque 2 106.44Output DubuqueQuitSample Output (Test 1)Add MadisonMadison added to the list.Add ChicagoChicago added to the list.Update Madison 2 60.75Destination Madison updated with 2 packages weighing 60.75 lbs.Update Chicago 4 180Destination Chicago updated with 4 packages weighing 180.00 lbs.Update Chicago 3 46.1Destination Chicago updated with 3 packages weighing 46.10 lbs.Output ChicagoAverage weight of all packages to Chicago: 32.30Output MadisonAverage weight of all packages to Madison: 30.38Add DubuqueDubuque added to the list.Update Dubuque 4 400Destination Dubuque updated with 4 packages weighing 400.00 lbs.Clear ChicagoOutput ChicagoAverage weight of all packages to Chicago: 0.00Update Dubuque 2 106.44Destination Dubuque updated with 2 packages weighing 106.44 lbs.Output DubuqueAverage weight of all packages to Dubuque: 84.41QuitNormal termination.Sample Input (Test 2)Add MadisonAdd ChicagoAdd DubuqueAdd OrlandoAdd MadisonAdd MiamiAdd DenverUpdate Chicago 3 40.5Update Madison 2 50.79Output ChicagoOutput DenverUpdate Orlando 38 482.12Update Denver 10 100.33Clear ChicagoOutput ChicagoClear DenverQuitSample Output (Test 2)Add MadisonMadison added to the list.Add ChicagoChicago added to the list.Add DubuqueDubuque added to the list.Add OrlandoOrlando added to the list.Add MadisonMadison is already in the list.Add MiamiMiami added to the list.Add DenverDenver not added. List is full.Update Chicago 3 40.5Destination Chicago updated with 3 packages weighing 40.50 lbs.Update Madison 2 50.79Destination Madison updated with 2 packages weighing 50.79 lbs.Output ChicagoAverage weight of all packages to Chicago: 13.50Output DenverCannot output. Denver is not in the list.Update Orlando 38 482.12Destination Orlando updated with 38 packages weighing 482.12 lbs.Update Denver 10 100.33Cannot update. Denver is not in the list.Clear ChicagoOutput ChicagoAverage weight of all packages to Chicago: 0.00Clear DenverCannot clear. Denver is not in the list.QuitNormal termination.代写CS Finance|建模|代码|系统|报告|考试编程类:C++,JAVA ,数据库,WEB,Linux,Nodejs,JSP,Html,Prolog,Python,Haskell,hadoop算法,系统 机器学习金融类:统计,计量,风险投资,金融工程,R语言,Python语言,Matlab,建立模型,数据分析,数据处理服务类:Lab/Assignment/Project/Course/Qzui/Midterm/Final/Exam/Test帮助代写代考辅导天才写手,代写CS,代写finance,代写statistics,考试助攻E-mail:[email protected]微信:BadGeniuscs 工作时间:无休息工作日-早上8点到凌晨3点如果您用的手机请先保存二维码到手机里面,识别图中二维码。如果用电脑,直接掏出手机果断扫描。

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。