Select Page

CSE 310 UNT Binary Hexadecimal and Quaternary Numbers Questions

Question Description

please no plagiarism (Please open the pdf file to view the question in the correct format)!!!!!!!!!!!

If a sample run is given, make sure that your code matches it EXACTLY.If you have questions about what is output to screen and what is user input, please ask me.HW Submission requirements:1) Put your name and ID number on the top of EACH assignment (in comments for programs)2) Name each file the name written in blue above each problem3) Put all the files into a folder and zip it4) Name the zipped folder with all assignments HW6.zip (5 point deduction for incorrect name)MAKE SURE ALL PROGRAMS ARE PROPERLY INDENTED-automatic 10 point deductionALL CODES SHOULD RUN ON THE VIRTUAL MACHINE. The TA will not check this because it is a completion grade,but YOU WILL BE TESTED ON YOUR VM KNOWLEDGE (command line and general usage) so it is in your bestinterest to actually practice this• You can write the code on your computer and put it in the shared folder with the VM to run it• You could also try to use one of the editors on VM (remember that Codeblocks is also on the VM)• You should be able to compile and run the program on the command line on the VMProblem 1 (20 points) -Write a program Submit a program called: grade_commandline.cCreate a grade calculator for that says whether the final grade for a course is A, B, C, D or F once you enter allgrades. On the command line, you should enter the number of HWs, quizzes and exams along with the weightof each in the order: number of HWs weight of HWs number of exams weight of exams number of quizzesweight of quizzesFor example: C computer$ ./a.out 3 15 3 70 5 15number of HWs-3weight of HWs-15%number of exams-3weight of exams -70%number of quizzes-5weight of quizzes-15%If the user tries to run the program without all of the information given above, the program should exit:C computer$ ./a.outMissing info. Exiting…C computer$ ./a.out 1 2Missing info. Exiting…If the user does not enter the weights correctly (meaning the weights cannot accurately be used in a gradingscheme), the program should exit:C computer$ ./a.out 3 15 3 70 5 50Weights not accurate…Exiting…Here, the weights are 15%, 70%, 50%, which is greater than 100%Once you have the correct command line information from the user, then the program should allow the userto type in all the grades (using the command line information for the number of HWs, exams and quizzes). Ifthe user tries to enter a grade that is not between 0-100 (inclusive of 0 and 100), the user should be reprompted to enter a valid grade (see sample run). The final numeric grade and corresponding letter grade(using the same letter grade scheme shown on my syllabus) should be output to screen.• You should hold the weight and average for each item (HWs/exams/quizzes) in: float grades[3][2];o For example, the first element of grades might be {.75, 95.4}, where .75 is the weight of theHWs and 94.5 is the overall HW avg• You should create two functions:o float calculate_grades(int num_grades, char type[])§ This function takes the number of grades and the type of grades you are entering andreturns the average. For example, num_grades might be 5 and type might be HW andthe function might return 95.4, meaning the HW grade avg is 95.4o void output_letter(float grades[][2])§ This function takes the float 2D array (mentioned above) and outputs the numeric gradeand corresponding letter grade for the course.Sample run:C computer$ gcc –o grades grade_stuff1.cC computer$ ./grades 3 15 3 70 5 15Enter HW grade 1: 100Enter HW grade 2: 95Enter HW grade 3: 78Enter exam grade 1: 95Enter exam grade 2: -10–Not a valid grade. Re-enter: 104–Not a valid grade. Re-enter: 67Enter exam grade 3: 89Enter quiz grade 1: 45Enter quiz grade 2: 100Enter quiz grade 3: 89Enter quiz grade 4: 76Enter quiz grade 5: 91Final numeric grade: 84.25You have a B!Problem 2 (40 points) -Write a program Submit a program called: grade_file.cProfessor F keeps student grades in a file in the following format:Zackaria Student nameHW grade type4 Number of HWs30 HW weight88 HW grade 1100 HW grade 290 HW grade 368 HW grade 4Exam grade type3 Number of exams50 exam weight95 exam grade 1100 exam grade 288 exam grade 3Quiz grade type3 Number of quizzes20 quiz weight95 quiz grade 166 quiz grade 295 quiz grade 3Using the given main function below (DO NOT MODIFY), create a program that outputs a file with the finalnumeric and letter grade. The output file should be named: studentname_finalgrade.txt (as shown below)Notes:• There will never be more than 6 grades for any HW, Exam or Quiz. You do not need to check theweights like in problem 1-assume the weights are always correct.• The information for any grade type should be kept in a 2D int array, where for each element (in theactual 2D array):o the first element (in each element of the 2D array) will be the weight and the second elementwill be the number of grades-the rest of the array should be the actual grades read in from thefile.Sample Run 1:C computer$ gcc practice.cC computer$ ./a.out grades_student2.txtGrades for: ZackariaGetting: HWGetting: ExamGetting: QuizGrade file successfully created.If the filename is not given on the command line, the user should enter it in the program:C computer$ ./a.outFilename not give on command line. Enter filename: grades_stud

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now