Object Oriented Programming

I’m working on a Engineering exercise and need support.

A skill-testing question, typically an exercise in arithmetic, is attached to many sweepstakes and contests in Canada. (Though not important for this assignment, this is used to work around a Canadian law making it illegal to distribute money or prizes for games of luck. The skill-testing question adds an element of skill to the game, which makes it legal.) A skill-testing question typically looks like the following: What is the answer to 4 + 2 × (8 − 2)/3?

Write a program that solves any skill-testing question in the form + × ( − )/ for any positive integers , , , , and . The user should be presented a message on the console to enter the values of , , , , and , one at a time, and then output the answer of the skill-testing question to the console.

Submit your source code in a file named SkillTest.java!

Sample input and output (inputs preceded by >):

Skill-testing question: a + b * (c – d) / e Please enter a:

>4

Please enter b:

>2

Please enter c:

>8

Please enter d:

>2

Please enter e:

>3

The answer to the skill-testing question is 8.0

Additional practice problems from the textbook: 1.8, 1.11, 2.4, 2.5, 2.6, 2.12, 2.17

Get 20% discount on your first order with us. Place an order and use coupon: GET20

Posted in Uncategorized