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
Nikolay [14]
3 years ago
8

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", on a line by itself. There should not be a period in the output.
Computers and Technology
1 answer:
shutvik [7]3 years ago
3 0

Answer:

I will write the code in C++ and JAVA                    

Explanation:

<h2>C++ Program:</h2>

#include <iostream>

using namespace std;

int main()

{ std::string NAME;  

// i have used std::string so that the input name can be more than a single character.

std::cout << " enter the name"; // take an input name from user

std::getline(std::cin,NAME);

int AGE;

       cout<<"Enter age";  //takes age from the user as input

       cin>>AGE;

   cout<<"The age of "; std::cout <<NAME; cout<< " is " << AGE; }

/* displays the message for example the name is George and age is 54 so    message displayed will be The age of George is 54 and this will be displayed without a period */

<h2>Explanation:</h2>

The program first prompts the user to enter a name and the asks to input the age of that person. As per the requirement the if the user enter the name George and age 54, the program displays the following line as output:

The age of George is 54

Here  std::string is used so that the input string can be more than one character long.

<h2>JAVA code</h2>

import java.util.*;

public class Main

{ public static void main(String[] args) {

String NAME;

Scanner sc = new Scanner(System.in);

System.out.println("Enter a name:");

NAME= sc.nextLine();

int AGE;

Scanner scanner = new Scanner(System.in);

System.out.println("Enter age:");

AGE = Integer.parseInt(scanner.nextLine());

System.out.print("The age of " + NAME + " is " + AGE); }}

<h2>Explanation:</h2>

This is the JAVA code which will work the same as C++ code. The scanner class is used to read the input from the user. The output of the above JAVA code is as follows:

Enter a name: George

Enter age: 45

The age of George is 45

You might be interested in
This is for pepole to make friends
labwork [276]

Answer:

false

Explanation:

8 0
3 years ago
Read 2 more answers
Which computers were the first PCs with a GUI<br> MS-DOS <br> Linux<br> Windows<br> Mac
sergeinik [125]

Answer:

The first computer with a GUI were linux, microsoft and apple.

Explanation:

I think this is right. Hope it helped <3

8 0
3 years ago
Read 2 more answers
Why would you want to hyperlink objects into your own Google Slides presentation? (Select all that apply.) Select All Correct Re
asambeis [7]

The correct answers are A.  For extending the learning experience for students. C. So students can use the Slides for review and can go to additional resources outside of the presentation. D. To make the presentation more graphically appealing

Explanation:

The use of hyperlink objects in presentations means objects such as images, texts, or icons are associated with links or websites students can easily access by clicking on the specific image or element. This might be used in educational contexts to allow students to have a complete learning experience by providing alternative and external sources outside the presentation. For example, if the topic is space hyperlinks to NASA website can be included. This means, hyperlink objects extend learning experiences and provide additional resources (Option A and D).

Besides this, this resource can make a presentation more appealing as links to images, videos, and other visually interesting resources can be included (Option D). However, it also breaks the linearity of the presentation as students will need to move to other websites as they go through the presentation.

5 0
3 years ago
The equation x + y2-4x+2y=b describes a circle.
liberstina [14]

Answer:

-1

Explanation:

The given equation can be written as

-3x +y^2 +2y +1=b+1

-3x +(y+1)^2=b+1

(-3x-b)+ (y+1)^2=1

This is to be compared with (x-a)^2 + (y-b)^2=c^2

where (a,b) is the center, and c is the radius of the circle.

Thus, we get y=-1, and this is our answer.

6 0
4 years ago
HELP 10 POINTS AND BRAINLIEST FOR BEST ANSWER! EASY I PROMISE! HELPFUL ANSWERS ONLY PLEASE HURRY!
tiny-mole [99]

Answer:

WATCH

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • I need help please?!!!!!!!!!
    15·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    15·1 answer
  • Function templates ___________.
    5·1 answer
  • Which hypervisor works on older pcs without hardware virtualization support?
    9·2 answers
  • Write a program that accepts a time as an hour and minute. Add 15 minutes to the time, and output the result. Example 1: Enter t
    11·1 answer
  • Which function can you perform on a word processor but not on a typewriter?
    11·1 answer
  • G i r l s o n l y j o i n <br> id= ons jcuv jke
    13·2 answers
  • My Macbook computer charger is burned from the side od the cord. -_- Great way to start school. Anything i should do?
    15·2 answers
  • ______ provide visual representations of the options available for a given command
    7·1 answer
  • All Office programs have similar commands on the tab for changing the document view a. File b. View c. Locate d. display ​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!