Question

In: Computer Science

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 !!

Solutions

Expert Solution

1.

Code:

import java.util.*;
class ageNext
{
   public static void main(String args[])
   {
       Scanner sc=new Scanner(System.in);
       int age;
       System.out.print("Enter your age: ");
       age=sc.nextInt();
       System.out.print("Next year your age will be: "+(age+1));
   }
}

Code Screenshot:

Output Screenshot:

2.

Code:

import java.util.*;
class youngest
{
   public static void main(String args[])
   {
       Scanner sc=new Scanner(System.in);
       int yourAge,friendAge;
       System.out.print("Enter your age: ");
       yourAge=sc.nextInt();
       System.out.print("Enter your friend's age: ");
       friendAge=sc.nextInt();
       if(yourAge<friendAge)
       {
           System.out.print("You are the youngest.");
       }
       else
       {
           System.out.print("Your friend is the youngest.");
       }
   }
}

Code Screenshot:

Output Screenshot:


Related Solutions

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.
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
Q1: Write a Java program that will display different messages depending on your age. Your program...
Q1: Write a Java program that will display different messages depending on your age. Your program should ask the user for his/her name and their age in years and give one or more answers from the following ones below: if the age of the user is less than 16, the program should print on the screen “You are not allowed to drive at the moment”. if the age of the user is less than 18, the program should print on...
Q1: Write a Java program that will display different messages depending on your age. Your program...
Q1: Write a Java program that will display different messages depending on your age. Your program should ask the user for his/her name and their age in years and give one or more answers from the following ones below: if the age of the user is less than 16, the program should print on the screen “You are not allowed to drive at the moment”. if the age of the user is less than 18, the program should print on...
(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...
What would be your initial thoughts if a family member started to display the signs of...
What would be your initial thoughts if a family member started to display the signs of being part of a terrorist or extremist group? How would you approach your family member to deter him or her from filtering into a terrorist or extremist group?
Write a program that accept an integer input from the user and display the least number...
Write a program that accept an integer input from the user and display the least number of combinations of 500s, 100s, 50s, 20s, 10s, 5s, and 1s. Test your solution using this samples] a. Input: 250 Output: 1x200s, 1x50s b. Input: 1127 Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s c. Input: 1127 Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s d. Input: 19 Output: 1x10s, 1x5s, 4x1s ​[Hints] o Use division to determine the number of occurrence of each element (i.e. 200, 100)...
Using the chart below, create a graph that would be appropriate to display age range statistics....
Using the chart below, create a graph that would be appropriate to display age range statistics. First row (1,2,3,4,5) is the header row and should not be included in your graph. 1 2 3 4 5 42 52 16 13 3 51 18 17 54 4 62 91 25 21 6 10 85 6 68 9 Instructions: Using the numbers in the above chart, select the appropriate graphic representation to use if the data represented age. Using your graph what...
Write a Java program that will display different messages depending on your age. Your program should...
Write a Java program that will display different messages depending on your age. Your program should ask the user for his/her name and their age in years and give one or more answers from the following ones below: if the age of the user is less than 16, the program should print on the screen “You are not allowed to drive at the moment”. if the age of the user is less than 18, the program should print on the...
Input from console 3 double numbers, compare these 3 numbers and display them from small to...
Input from console 3 double numbers, compare these 3 numbers and display them from small to great. In Java Please
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT