Exercise 2 - Learning to Trace (to Fix Semantic Errors). This exercise should be done in the "Exercise2" file providea to you. A major part of being able to trace your program to find out what's wrong is first figuring out what the program should be doing, and then looking at the output that the program currently produces to see what it is actually doing. In this way, you can identify what's not right, or, specifically, which part of the code is not doing the right thing and make the necessary adjustments. We want a program which, when run, should be providing the following output: Required Output: Welcome user. This program demonstrates the importance of fixing semantic errors. In addition, it helps you calculate your final mark and the test mark needed to pass with a certain final mark. The prac mark is 75% which is weighted at 0.4 The tut mark is 67% which is weighted at 0.35 The test mark is 68% which is weighted at 0.25 The target final mark is 75% With the current marks, you're looking at a final mark of 70.45% In order to reach your target mark of 75%, you need a test mark of 86.2% Thanks Below is the current code for the program which is NOT doing what it should be (as above) because it has semantic errors: Current Program (that needs modification): print ("Welcome user.") pracmark - 75 #Only change to your desired value tutmark - 67 Only change to your desired value testmark 68 Only change to your desired value pracweight - 0.4 Only change to your desired value tutweight - 0.35 #Only change to your desired value testweight - 0.25 Only change to your desired value targmark - 75 Only change to your desired value print ("The prac mark is " + str (testmark) + "8 which is weighted at "+ str (tutweight)) print ("The mark is "+ str (testweight)) print ("You're trying for" + str (targmark) + "8") print ("") DON'T CHANGE the line below curfinalmark - pracweight pracmark + tutweight * tutmark + testweight testmark DON'T CHANGE the line below testmarkreq - (targmark - pracweight pracmark tutweight tutmark) / testweight print ("Your mark is " + str (curfinalmark) + "8") print ("For the target " + str (curfinalmark) + "you need a test" + str (testmarkreq) + "8") print ("Bye") Start by typing in the code given. Note that you are only required to make changes to the lines that contain "print" functions. Don't change any lines that have a "Dan't change" comment or a "vOnly change to your deutred value" comment and certainly don't change any variable names or computations. Make changes to the "print" functions to produce exactly the same output as we require above (including any spaces and empty lines). Learn to be very very very sensitive. Make sure the final output is exactly like the output required. Also, feel free to add any print lines that you think should be there but are possibly missing.
Exercise 2 - Learning to Trace (to Fix Semantic Errors). This exercise should be done in the "Exercise2" file providea to you. A major part of being able to trace your program to find out what's wrong is first figuring out what the program should be doing, and then looking at the output that the program currently produces to see what it is actually doing. In this way, you can identify what's not right, or, specifically, which part of the code is not doing the right thing and make the necessary adjustments. We want a program which, when run, should be providing the following output: Required Output: Welcome user. This program demonstrates the importance of fixing semantic errors. In addition, it helps you calculate your final mark and the test mark needed to pass with a certain final mark. The prac mark is 75% which is weighted at 0.4 The tut mark is 67% which is weighted at 0.35 The test mark is 68% which is weighted at 0.25 The target final mark is 75% With the current marks, you're looking at a final mark of 70.45% In order to reach your target mark of 75%, you need a test mark of 86.2% Thanks Below is the current code for the program which is NOT doing what it should be (as above) because it has semantic errors: Current Program (that needs modification): print ("Welcome user.") pracmark - 75 #Only change to your desired value tutmark - 67 Only change to your desired value testmark 68 Only change to your desired value pracweight - 0.4 Only change to your desired value tutweight - 0.35 #Only change to your desired value testweight - 0.25 Only change to your desired value targmark - 75 Only change to your desired value print ("The prac mark is " + str (testmark) + "8 which is weighted at "+ str (tutweight)) print ("The mark is "+ str (testweight)) print ("You're trying for" + str (targmark) + "8") print ("") DON'T CHANGE the line below curfinalmark - pracweight pracmark + tutweight * tutmark + testweight testmark DON'T CHANGE the line below testmarkreq - (targmark - pracweight pracmark tutweight tutmark) / testweight print ("Your mark is " + str (curfinalmark) + "8") print ("For the target " + str (curfinalmark) + "you need a test" + str (testmarkreq) + "8") print ("Bye") Start by typing in the code given. Note that you are only required to make changes to the lines that contain "print" functions. Don't change any lines that have a "Dan't change" comment or a "vOnly change to your deutred value" comment and certainly don't change any variable names or computations. Make changes to the "print" functions to produce exactly the same output as we require above (including any spaces and empty lines). Learn to be very very very sensitive. Make sure the final output is exactly like the output required. Also, feel free to add any print lines that you think should be there but are possibly missing.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Topic Video
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education