Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

COSC 1046 Test 2 20S SCIENCE I COSC 1046-F18-TES 26) (12 marks) Consider the following partial program There are six (6) sy below. Circle each

image text in transcribed
COSC 1046 Test 2 20S SCIENCE I COSC 1046-F18-TES 26) (12 marks) Consider the following partial program There are six (6) sy below. Circle each error and state whether it is a logie error or a syntas ervor. o could be corrected. You don't need to rewrite everything, just hake a note of the con syntax andior logie essors nth hard-coded some values to simplity the program publie class simpleMath public static void main (stringt1 arga) atring calculate- //it the user wants to proceed calculate some things if (calculate "yea") ( a logic escmore All you howe to de is mave Akerm int num1-100 int num2 200 > errore : Thru should be .cindy brane. ,. int sum-num1 + num2,' Ay hiaenror. You have to odd a ourdy brace. int difterence Math.abs (numi -num2) ecrore to should be o2.num int average (numlnum2)2 int max = 01 L (num2 t' a logie erutor. Tust have to itinang t.num2){erotoc: av can't be o. Jogical ertrort." max-numl: min num2: max " num2erertorr : min-num!, rore. All you have do is "to rul one eur)y brno //print the results -emor : {1 Logie error 5erteneb.ed System.out.printin("Sum:"sum) System.out.printin ("Max: max); System.out.printin ("Min: " + min) System.out.printin( Avg:avg): elsel System.exit (o)

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

Students also viewed these Databases questions

Question

I am paid fairly for the work I do.

Answered: 1 week ago

Question

I receive the training I need to do my job well.

Answered: 1 week ago