Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you please help me with this College of Computer Science & Engineering College of Computer Science & Tngineering Deqariment af Computer Science & Artificial

image text in transcribedcan you please help me with this

College of Computer Science & Engineering College of Computer Science & Tngineering Deqariment af Computer Science & Artificial Intelligence Department of Computer Science Artificial Intelligence Unity of india University of redah 1. Synliex Errers errors in the "grainmar" of the proyretriming language. These are caught by the compiler and listed out with line number and error found. All syntax errors must be corrected before the program will run 2. Logic Elroscrrors in the logic of the algorithm. These carors cmphasize the need for a correct algorithm. For example, if the statements are out of order, or if there are crrors in a formula, or if there are missing stess, the program can still rum and give you ulput, but it may be the wrong output . Since there is no list of errors for logic errus, you may not realize you have errors unless you check your output. It is very important to know what output you cxpect. You should test your programs with diffcreut inputs and know what output to expoct in cach Litse. 1 Aall your new.locode here Display the value in the piy variable. Task #2 Compile and Execute a Program 1. Compile Pay.jave using the JDK or a Java IDE as directed by your instructor. 2. You should not receive ny error messages. 3. When this percigrarn is executed, it will ask the user for inpul You should calculate several different cases by hand. Since there is a critical point at which the calenlation changes you should test three different cases: the critical point. A number above the critical point, and u number below the critical print 3. Runtime errors crrors that do not occur until the program is run, and then may only occur with some calat. These are emphasize the need for completely testing your program. You want to calculate by hand so that you can chock the logic of the program. Fill in the chart below with your test cases and the result you get when calculating ly hand. 4. Exccute the program using your first act of data. Rccord your result. You will nood to execute (run) the program three times to test all your data Finally, you will document the program by adding comments. Comments are not read by the computer, they are for use by the programmer. They are to help a programmer document what the program cloes and how it accomplishes it. Note: you do not need to compile again. Once the program compiles correctly once, it can be cxccutod many times. You only nood to compile again if you make changes to the code. Hours Rate Pay hand calculated) May (program result) Tasks of Chapter 1 Task #1 Writing an Algorithm 1. Copy the file d'ay.java (see Code Listing 1.1) from the Student Files or as directed by your instructor 2. Create the project in your Java Nellleans. Examine the file and compure it with the pseuticccde helow. Notice that the preudocxle tikes not include every time of cxle. The only important difference between the cxample pseudocode and the Java code is in the calculation. You need to fill in lines that tell in English what the calculation part of Payava is doing Tasks of Chapter 2 Task #1 Correcting Logic Errors in Formulas 1. Copy the file Numeric Typer.java (see Code Listing 2.1) from the Student Files it as directed by your insticker 2. Compile the scurte lile, run the prograrn, and observe the culput. Samne of the output is incorrect. You need to correct logic crrors in the average formula and the temperature conversion fornula. The logic crrors could be dus to conversion between data types order of operations, or formula probleins. Display "How mary hors did you work?" Inpul hours. Display "low muck are wou paid per how?". Input rate College of Computer Science & Engineering College of Computer Science & Tngineering Deqariment af Computer Science & Artificial Intelligence Department of Computer Science Artificial Intelligence Unity of india University of redah 1. Synliex Errers errors in the "grainmar" of the proyretriming language. These are caught by the compiler and listed out with line number and error found. All syntax errors must be corrected before the program will run 2. Logic Elroscrrors in the logic of the algorithm. These carors cmphasize the need for a correct algorithm. For example, if the statements are out of order, or if there are crrors in a formula, or if there are missing stess, the program can still rum and give you ulput, but it may be the wrong output . Since there is no list of errors for logic errus, you may not realize you have errors unless you check your output. It is very important to know what output you cxpect. You should test your programs with diffcreut inputs and know what output to expoct in cach Litse. 1 Aall your new.locode here Display the value in the piy variable. Task #2 Compile and Execute a Program 1. Compile Pay.jave using the JDK or a Java IDE as directed by your instructor. 2. You should not receive ny error messages. 3. When this percigrarn is executed, it will ask the user for inpul You should calculate several different cases by hand. Since there is a critical point at which the calenlation changes you should test three different cases: the critical point. A number above the critical point, and u number below the critical print 3. Runtime errors crrors that do not occur until the program is run, and then may only occur with some calat. These are emphasize the need for completely testing your program. You want to calculate by hand so that you can chock the logic of the program. Fill in the chart below with your test cases and the result you get when calculating ly hand. 4. Exccute the program using your first act of data. Rccord your result. You will nood to execute (run) the program three times to test all your data Finally, you will document the program by adding comments. Comments are not read by the computer, they are for use by the programmer. They are to help a programmer document what the program cloes and how it accomplishes it. Note: you do not need to compile again. Once the program compiles correctly once, it can be cxccutod many times. You only nood to compile again if you make changes to the code. Hours Rate Pay hand calculated) May (program result) Tasks of Chapter 1 Task #1 Writing an Algorithm 1. Copy the file d'ay.java (see Code Listing 1.1) from the Student Files or as directed by your instructor 2. Create the project in your Java Nellleans. Examine the file and compure it with the pseuticccde helow. Notice that the preudocxle tikes not include every time of cxle. The only important difference between the cxample pseudocode and the Java code is in the calculation. You need to fill in lines that tell in English what the calculation part of Payava is doing Tasks of Chapter 2 Task #1 Correcting Logic Errors in Formulas 1. Copy the file Numeric Typer.java (see Code Listing 2.1) from the Student Files it as directed by your insticker 2. Compile the scurte lile, run the prograrn, and observe the culput. Samne of the output is incorrect. You need to correct logic crrors in the average formula and the temperature conversion fornula. The logic crrors could be dus to conversion between data types order of operations, or formula probleins. Display "How mary hors did you work?" Inpul hours. Display "low muck are wou paid per how?". Input rate

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

5. Discuss the key components of behavior modeling training.

Answered: 1 week ago

Question

4. Develop a self-directed learning module.

Answered: 1 week ago