Question

Java Programmming Given three numbers from user input, decrement the first number by 2 and increment...

Java Programmming

Given three numbers from user input, decrement the first number by 2 and increment the second number by 1, Then do the magic calculations as follows: get the sum of the first two numbers, deduct the third number from the second and get the product of the first and third number, then sum up the results of the three magic calculations.

Sample run 1:                                    

Enter three numbers separated by spaces: 4 2 3     

Output: Result of Magic calculations = 11

Sample run 2:                                    

Enter three numbers separated by spaces: 1 2 3    

Output: Result of Magic calculations = -1

a)    Write a Pseudocode to solve the above problem (should be in Java)

b)    Create a flowchart for the above pseudocode

SUBMIT TWO DIFFERENT FILES FOR THE ABOVE TASKS.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Java Programmming Given three numbers from user input, decrement the first number by 2 and increment...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a JAVA program that in two numbers from user input, the program then does the...

    Create a JAVA program that in two numbers from user input, the program then does the following arithmetic calculations. The program will run in ascending order if the first number is small and in descending order of the first number is bigger. The program then alternates between addition(ODD) and subtraction(EVEN) depending on the previous number see examples below   [15] Sample run 1: Enter two numbers: -3 2 Output: The following arithmetic calculations were performed : Arithmetic operations = (-3) +...

  • In the Java language APCS Sorting Numbers Lab Write a program that reads in 3 floating-point...

    In the Java language APCS Sorting Numbers Lab Write a program that reads in 3 floating-point numbers (decimal numbers) and prints the three numbers in sorted order from smallest to largest. In your main method, create a scanner and get the 3 numbers from the user. Create a separate method called sort that accepts the 3 numbers prints them in the appropriate order. Sample Run#1 Please enter first number: 4 Please enter second number: 9 Please enter third number: 2.5...

  • The input consists of n numbers a1, a2, . . . , an and a target...

    The input consists of n numbers a1, a2, . . . , an and a target value t. The goal is to determine in how many possible ways can we add up two of these numbers to get t. Formally, your program needs to find the number of pairs of indices i, j, i < j such that ai+aj = t. For example, for 2, 7, 3, 1, 5, 6 and t = 7, we can get t in two...

  • 0 The sum of three numbers is 12. The sum of twice the first number, 5...

    0 The sum of three numbers is 12. The sum of twice the first number, 5 times the second number, and 6 times the third number is 62. The difference between 4 times the first number and the second number is - 2. Find the three numbers first number: second number: third number:

  • The sum of three numbers is 15. The sum of twice the first​ number,4 times the...

    The sum of three numbers is 15. The sum of twice the first​ number,4 times the second​ number, and 5 times the third number is 52. The difference between 6 times the first number and the second number is 40. Find the three numbers. first​ number: second​ number: third​ number:   

  • write a java program that prompts a user to enter two different numbers, divide the first...

    write a java program that prompts a user to enter two different numbers, divide the first number by second and prints the result

  • Write a C program that asks the user to enter three numbers (integres). A menu will...

    Write a C program that asks the user to enter three numbers (integres). A menu will be displayed to let the user choose one of the three options: print the two highest numbers, product of the three numbers or the division of the second by the by the third if the third is not zero. See the sample runs. Required: Your code must use -One function to get the numbers from the user One function for each of the three...

  • Write a program that receives a series of numbers from the user and allows the user...

    Write a program that receives a series of numbers from the user and allows the user to press the enter key to indicate that he or she is finished providing inputs. After the user presses the enter key, the program should print the sum of the numbers and their average.   >>> totalSum =0 >>> count=0 >>> while True:    number=input("Enter a number or press enter to quit:")    if number =="":        break    totalSum += float(number)    count+=1...

  • write a program in java to print all the powers of 2 below a certain number...

    write a program in java to print all the powers of 2 below a certain number and calculate their sum. Make sure your program conforms to the following requirements. 1. Accept the upper limit from the user (as an integer). 2. These numbers grow very fast. make sure the sum variable is of the "long" type. You can assume that the test output will be less that LONG MAX. 3.Print all numbers as a running sum, and finally print their...

  • Program Requirements First, find all the prime numbers between 2 and a user-inputted number from the...

    Program Requirements First, find all the prime numbers between 2 and a user-inputted number from the console (inclusive). The identified prime numbers must be stored in an array . The inputted number should be between 0 and 1000 (inclusive). array is large enough to o Make sure your hold all the prim e numbers. Dynamic memory allocation is not required for this assignment, so you can have unused space in your array Make sure you can handle the cases of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT