1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
scoundrel [369]
4 years ago
5

Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra" and "Zoe") and ages respect

ively. Write some code that reads in a name and an age and then prints the message "The age of NAME is AGE." where NAME and AGE are replaced by the values read in for the variables name and age. For example, if your code read in "Rohit" and 70 then it would print out "The age of Rohit is 70.".
Computers and Technology
1 answer:
Irina18 [472]4 years ago
3 0

Answer:

import java.util.Scanner;

public class num2 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Name");

       String name = in.next();

       System.out.println("Enter Age");

       int age = in.nextInt();

       System.out.println("The age of "+name +" is "+age);

   }

}

Explanation:

Java programming language is used to write the code.

The scanner class is used to prompt and receive values for name and age which are stored in the appropriate variables.

The key idea here is using string concatenation in the output statement in order to print the desired output

You might be interested in
Consider two communication technologies that use the same bandwidth, but Technology B has twice the SNR of technology A. If tech
MrRissso [65]

Answer:

55kbps

Explanation:

7 0
4 years ago
ساعدوني على الإجابة على هذه الأسئلة
aleksandr82 [10.1K]

Answer:

Can you Translate for Russian or Eanglish

Explanation:

7 0
3 years ago
There are several different types of RAM, each with its own purpose. Name the three types of RAM and briefly describe their func
Neko [114]
Well we have SRAM(Static Random Access Memory) is faster, have a lower density but it is more expensive.
While DRAM(Dynamic Random access memory) is just the opposite.
Those are the only two, I know exist.
3 0
4 years ago
Read 2 more answers
Write the pseudocode (using the scheme in the FILES section of CANVAS) as a Word or .txt file (and upload it) to
mezya [45]

Answer:

The pseudo code is in the attachment.

Explanation:

The pseudo code is in the attachment.

Download txt
7 0
3 years ago
You're a ticket agent for a commercial airline and responsible for checking the identification for each passenger before issuing
algol13

Answer:

Follows are the code to this question:

import java.util.*;//import package for user input  

public class Main //defining class  

{

  public static void main(String[] as)//main method

  {

      boolean x,y,z;//defining boolean variable

      Scanner ox= new Scanner(System.in);//create Scanner class object for user input

      System.out.println("input value: "); //print message  

      x=ox.nextBoolean();//input value

      y=ox.nextBoolean();//input value

      z=ox.nextBoolean();//input value

      System.out.println("Output: ");//print message

      System.out.println(x || (y &&z));//use print method to check value and print its value  

  }

}

Output:

1)

input value:  

true

false

false

Output:  

true

2)

input value:  

false

true

true

Output:  

true

3)

input value:  

false

false

false

Output:  

false

Explanation:

In the given code, inside the class three boolean variable "x,y, and z" is declared, that uses the scanner class for input the value from the user end, and in the next print, the method is declared, that uses " OR and AND" gate for calculating the input value and print its value.

In the AND gate, when both conditions are true. it will print the value true, and in the OR gate, when one of the conditions is true, it will print the value true.  

3 0
4 years ago
Other questions:
  • Write a function max_magnitude() with two integer input parameters that returns the largest magnitude value. Use the function in
    15·1 answer
  • The laws governing search and seizure in the public sector are much more straightforward than those in the private sector. TRUE
    11·1 answer
  • Which payment type is best if you are trying to sick to a budget?
    15·1 answer
  • A ______ oversees the planning and implementation of sophisticated security measures to block unauthorized access but at the sam
    7·1 answer
  • A(n) _____ uses spatial and nonspatial data and specialized techniques for storing coordinates of networks of lines (roads, rive
    8·1 answer
  • I think these might be the answers but im not to sure, so am I right? or wrong? please help
    11·2 answers
  • Which term describes the degree to which a network can continue to function despite one or more of its processes or components b
    14·1 answer
  • Which of the following audio file formats is best
    13·1 answer
  • Do you think<br> brain uploading<br> is a good idea?
    7·1 answer
  • Suppose we compute a depth-first search tree rooted at u and obtain a tree t that includes all nodes of g.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!