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:   

  • Create a program in Java with the following requirements: Using a Scanner and print statements, ask...

    Create a program in Java with the following requirements: Using a Scanner and print statements, ask the user to input 3 numbers. Use Java’s int data type…don’t worry about error checking for this assignment (assume the user doesn’t try to break your program) Store these three numbers into three variables Calculate the sum of all three numbers Calculate the product of all three numbers If all three numbers are even, output “Lucky Duck!” If all three numbers are odd, output...

  • 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...

  • JAVA Write a program that prompts the user to enter a year and the first three...

    JAVA Write a program that prompts the user to enter a year and the first three letters of a month name (with the first letter in uppercase) and displays the number of days in the month. If the input for month is incorrect, display a message as shown in the following sample run. SAMPLE RUN 1: Enter a year: 2001 Enter a month: Jan Jan 2001 has 31 days SAMPLE RUN 2: Enter a year: 2016 Enter a month: Feb...

  • 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...

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