Question

In: Computer Science

Computer Organization Input your age (my age is 20 years old) and display what your age...

Computer Organization

Input your age (my age is 20 years old) and display what your age would be next year(21 year)

Submit screen shots from Marie.

I think this should display on Java programming Language

Solutions

Expert Solution

Below is code in JAVA for the given problem statement.

I have mentioned inline comments for better understanding of code.

Do let me know in comments in case of any doubt.

import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        //scanner object will be used to read input given by user
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter your age:");
        int age = sc.nextInt(); // read the age entered by user
        // age after 21 years would be age+21 so update the value of age and display the result
        age = age+21;
        System.out.println("Your age after 21 years would be : "+age);
    }
}

Screenshot of code:

Sample Output:

1):

2):


Related Solutions

Q1) Input your age and display what your age would be next year. Submit screenshots from...
Q1) Input your age and display what your age would be next year. Submit screenshots from Marie. My age is 21 and please provide clear screenshots. Q2)  Get your age and your friend's age Determine who is the youngest Determine who is the oldest My age is 21 and my friend is 22 Marie is a stimulator and the program is Java. Kindly provide the work !!
Marielab1 input your age and display what your age would be next year. submit screen shots...
Marielab1 input your age and display what your age would be next year. submit screen shots from Marie. im 24 and going to be 25 next year.
Python age = input(‘How old are you? ’) if age >= 14 print(‘You may go on...
Python age = input(‘How old are you? ’) if age >= 14 print(‘You may go on the rollercoaster’) Read carefully - What will the program output if the user types ‘15’? 2. Concisely explain the difference between ‘while’ and ‘for’ ______________________________________________ 3.The __________statement terminates the loop containing it. Control of the program flows to the statement immediately after the body of the loop. 4.The ____________ statement is used to skip the rest of the code inside a loop for the...
You are 30 years old and want to retire at the age of age 65 and...
You are 30 years old and want to retire at the age of age 65 and expect to live another 25 years. On the day you retire, you want to have $900,000 in your retirement savings account. a) If you invest monthly starting one month from today and your investment earns 6.0 percent per year, How much money do you need to invest every month until you retire? b) You're retired with $900,000 and you have 25 more years. You...
You are currently 40 years old and intend to retire at age 60. To make your...
You are currently 40 years old and intend to retire at age 60. To make your retirement easier, you intend to start a retirement account. At the END of each of years, you will deposit some money to your retirement account till your retire. You expect the account will earn 7% per year. After retirement at age 60, you want to withdraw $10,000 from your retirement account at the END of each year for 10 years. How much money should...
Julia, your aunt, currently is 55 years old; she will retire at the age of 60....
Julia, your aunt, currently is 55 years old; she will retire at the age of 60. Last month, Julia just formed a portfolio with stock A, B, and C. Julia invest her retirement money equally in all 3 assets. Beta of each assets are as follows; bA = 2.21; bB = 1.85; and bC = 1.75 Aunt Julia is a very conservative investor, she can accept minimal risk and she can bear the maximum loss only 5% of her investment,...
(CODE IN PYTHON) Program Input: Your program will display a welcome message to the user and...
(CODE IN PYTHON) Program Input: Your program will display a welcome message to the user and a menu of options for the user to choose from. Welcome to the Email Analyzer program. Please choose from the following options: Upload text data Find by Receiver Download statistics Exit the program Program Options Option 1: Upload Text Data If the user chooses this option, the program will Prompt the user for the file that contains the data. Read in the records in...
Write a complete java program to get input of a person’s age and their years of...
Write a complete java program to get input of a person’s age and their years of current USA citizenship. Tell them if they are eligible to run for US House of Representatives, US Senate, or President. At first, have the program just run once and give the answer for the given inputs. Give the answer in a nice format and be clear which offices the person can run for. Write good and complete pseudo code. Next, put that program in...
Write a complete java program to get input of a person’s age and their years of...
Write a complete java program to get input of a person’s age and their years of current USA citizenship. Tell them if they are eligible to run for US House of Representatives, US Senate, or President. At first, have the program just run once and give the answer for the given inputs. Give the answer in a nice format and be clear which offices the person can run for. Write good and complete pseudo code. Next, put that program in...
main() module Display "Welcome to my Guess the number program!" while true display_menu() Get input if(option==1)...
main() module Display "Welcome to my Guess the number program!" while true display_menu() Get input if(option==1) user_guess() elif(option==2) computer_guess() else break user_guess() module random mynumber count=1 userGuesses=[] while True try Display "Guess a number between 1 and 10" Get guess while guess<1 or guess>10 Display "Guess a number between 1 and 10" Get guess except Display "numbers only" continue userGuesses.append(guess) if (guess<mynumber) Display "Too low" count=count+1 else if (guess>mynumber) Display "Too high" count=count+1 else if (guess==mynumber) Display "You guessed it...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT