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
worty [1.4K]
2 years ago
12

Write a C++ program to print name, age, class, school​

Computers and Technology
1 answer:
zloy xaker [14]2 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   string name;

   string age;

   string Nameclass;

   string school;

   cout<<"What is your name?\n";

   cin>>name;

   cout<<"What is your age?\n";

   cin>>age;

   cout<<"What is your class?\n";

   cin>>Nameclass;

   cout<<"What is your school?\n";

   cin>>school;

   cout<<"Name: " + name;

   cout<<"\nAge: " + age;

   cout<<"\nClass: " + Nameclass;

   cout<<"\nSchool: " + school;

   return 0;

}

Explanation:

You might be interested in
Kathi, the owner of Klothes for Kats, is excited about the launch of her first Local Catalog ad. She remembers there are a few d
mina [271]

Answer:

Map view

Explanation:

The view that will most likely be displayed would be a Map view, where potential customers can see the Klothes for Kats logo, store information, and in-stock products. This is because Local Catalog ads only have a small space that is used to promote what is being advertised. Therefore, in these small spaces the most important things need to be shown in order to attract as many people as possible with what the store offers. The ad needs to have the logo and store information so that the potential customers can easily know what store is being advertised on the ad. The ad also needs to show some of the popular in-stock products in order to attract individuals that are actually interested in the products that the store is trying to sell.

6 0
3 years ago
What's your fav show?
mezya [45]

Answer:

<h3>ITS DEPENDS IF I'M INTERESTED</h3>

Explanation:

HBU?^_________^

6 0
3 years ago
Read 2 more answers
_________values are stored as the number of seconds since the unix epoch (35 POINTS)
Nataly_w [17]

Answer:

he Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).

Explanation:

The answer above is from a secure website

3 0
3 years ago
What is security in Technology<br>​
maria [59]

Answer:

IT security is a set of cyber security strategies that prevents unauthorized access to organizational assets such as computers, networks, and data.

3 0
4 years ago
Read 2 more answers
Create a class named Horse that contains the following data fields: name - of type String color - of type String birthYear - of
kozerog [31]

Answer:

The program to this question can be given as:

Program:

class Horse   //define class Horse

{  

private String name;   //define variables.

private String color;  

private int birthYear;  

//define set method.

public void setName(String name)  

{  

this.name = name; //set value of name.

}

public void setColor(String color)  

{  

this.color = color; //set value of color.  

}  

public void setBirthYear(int birthYear)

{  

this.birthYear = birthYear;  //set value of birthYear

}  

//define get method.

public String getName()  

{  

return name;  //return name.

}  

public String getColor()

{  

return color;  //return color.

}  

public int getBirthYear()

{  

return birthYear;  //return birthYear.

}  

}

class RaceHorse extends Horse     //define class RaceHorse  

{

private String raceNum;            //define variable.

public void setRace(String raceNum)    //define set method.

{

 this.raceNum=raceNum;      //set value of raceNum.

}

public String getRace()

{

 return raceNum;   //return raceNum

}

}

public class Main      //define main class.

{

public static void main(String[] args) //define main method.

{

 Horse ob= new Horse();  //creating class objects.

 RaceHorse ob1 = new RaceHorse();

 ob.setName("XXX");       //calling function

 ob.setColor("BLACK");

 ob.setBirthYear(2008);

 ob1.setRace("Five hundred meter");

 //print return values.

       System.out.println("The name of the horse is " + ob.getName()+"." +"\n"+  

   "The horse's color is " + ob.getColor()+"."+"\n"+ "It was born in " + ob.getBirthYear() +  

   "."+"\n"+ ob.getName()+" has taken part in " + ob1.getRace() + " races.");

   

}

}

Output:

The name of the horse is XXX.

The horse's color is BLACK.

It was born in 2008.

XXX has taken part in Five hundred meter races.

Explanation:

In the above program firstly we declare the class that is Horse in this class we define a variable that name is already given in the question which are name, color, and birthYear. In these variables are name and color datatype is string and the birthYear datatype is an integer because it stores the number. Then we use the get and set function in the get function we return all variable value. and in the set function, we set the values of the variable by this keyword. Then we declare another class that is RaceHorse this class inherit Horse class. In the RaceHorse class, we define a variable that is raceNum that's data type is a string in this class we also used the get and set function. Then we declare the main class in the main class we define the main method in the main method we create the above class object and call the set and get function and print the values of the function.

6 0
4 years ago
Other questions:
  • You have just deployed SNMPv3 in your environment. Your manager asks you to make sure that your SNMP agents can only talk to the
    13·2 answers
  • The difference between an AutoCorrect entry and a building block is that the building block feature makes corrections automatica
    6·1 answer
  • Which of the following is a professional organization in the field of IT? Society for the Prevention of Cruelty to Animals (SPCA
    6·2 answers
  • Average of Grades - Write a program that stores the following values in five different variables: 98, 87, 84, 100, 94. The progr
    8·1 answer
  • What have very strong chemical bonds and cannot be reshaped when heated.​
    6·1 answer
  • Public class Dog
    7·1 answer
  • 6.7 — Trickier Trap 4
    7·2 answers
  • 1
    10·1 answer
  • Harry needs to make a presentation on packaging prototypes for a new product. Which presentation software elements can be use to
    9·1 answer
  • You want your computer to boot off of the network and have the ability to be brought out of sleep mode over the network. Which t
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!