Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C l iom the Internet can contain viruses. Unless you need to edit, it's safer to stay in pi, Name: Chapter 2 - Data and

image text in transcribed
image text in transcribed
image text in transcribed
C l iom the Internet can contain viruses. Unless you need to edit, it's safer to stay in pi, Name: Chapter 2 - Data and Expressions Section: int first second third, fourth; int product, sum, remainder, diff, quotient; Directions: Given the previous data declarations, write a line of code to: 1. Multiply first and second and store the result in product. 2. Add first second, third, and fourth and store the result in sum 3. Subtract fourth from second and store the result in diff. 4. Divide first by second and store in quotient. 5. Divide third by first and store the result in remainder, 6. Multiply all four numbers and store result in product 7. Multiply first and second, third and fourth, then subtract. Store in diff. 8. Multiply: sum of first and fourth by the sum of second and third. Store in product. 9. Add first to the remainder of dividing third by fourth. Store in remainder 13.3-5*2-1273 14.4 * 6-10 % 3 15.(2+6) * 3 %5 Write Java code required: a. Create a variable to store the number of students in a class. b. In ONE line of code, create a variable to store a student's letter grade and initialize the grade to A- c. Create a constant to store the maximum age for a teenager (19) Create a code segment that will 1. Create a constant to store the sales tax rate for Onondaga County (0825) 2. Create a variable to store the amount of sales tax to charge a customer 3. Create a variable to store the number of items purchased in a retail store. ENS 3-4 OF 4 4. Create a variable to store the price of the items 5. Create a variable to store the gross cost 6. Calculate the gross cost (#items * price) 7. Calculate the sales tax. 8. Calculate the final cost 9. ouptut the final cost to the screen

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

Step: 3

blur-text-image

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

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

=+. Show in Example 6.3 that P[IS, - L,| > L'/2+ 0.

Answered: 1 week ago