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
Sergio [31]
3 years ago
5

Write a program that asks the user for three names, then prints the names in reverse order.

Computers and Technology
1 answer:
sasho [114]3 years ago
8 0

Answer:

The program written in C++ is as follows'

#include<iostream>

using namespace std;

int main()

{

string names[3];

cout<<"Please enter three names: "<<endl;

for (int i = 0; i< 3;i++)

{

cin>>names[i];

}

for (int i = 2; i>= 0;i--)

{

cout<<names[i]<<endl;

}

return 0;

}

Explanation:

This line declares an array for 3 elements

string names[3];

This line prompts user for three names

cout<<"Please enter three names: "<<endl;

This following iteration lets user input the three names

for (int i = 0; i< 3;i++)  {  cin>>names[i];  }

The following iteration prints the three names in reverse order

for (int i = 2; i>= 0;i--)  {  cout<<names[i]<<endl;  }

You might be interested in
The ________ of a cpu dictates how many instructions the cpu can process each second.
makkiz [27]
Gigahertz is the correct answer I believe.
My processor is a i5-6600k with 3.5ghz so assuming GHz is the speed I believe it would be gigahertz
3 0
3 years ago
Send the memes whoever is the best will get that crown thing lol
shutvik [7]
I have to type 20 characters here so...

4 0
3 years ago
Read 2 more answers
Write statements that output variable numMugs as follows. End with a newline. Ex: If numMugs is 10, the program should output: N
baherus [9]

Answer:

numMugs=input(); #take input from the user and store it on a numMugs variable.

print ('Number of mugs:'+numMugs) #print the numMugs variable value with the Number of mugs: line.

Output:

  • If the input is 8 then the program is print Number of mugs: 8.
  • If the input is 'Harry' then the program is print Number of mugs: Harry.

Explanation:

  • The above program is in python language with the two statements one in input and the other is output.
  • The first line takes input and stores it into a variable named "numMugs".
  • The second line print the value as Number of mugs: value_of_numMugs.
  • The above program works for any type of input. It can work for the string data type or integer data type or character data type or any other data type.
3 0
3 years ago
A company pays its salespeople on a commission basis. The salespepople receive $200 per week plus 9% of their gross sales for th
Maurinko [17]

Answer:

using System;

     

public class Program

{

public static void Main()

{

 Console.Write("Enter gross sales: ");

 double sales = Convert.ToDouble(Console.ReadLine());

 double payment = 200 + (sales*0.09);

 Console.Write("total payment for this week is: "+payment);

}

}

Explanation:

May I suppose that you want a program in C# to calculate the week payment? in that case let review a solution:

using System;

     

public class Program

{

public static void Main()

{

//input the gross sales of the week

 Console.Write("Enter gross sales: ");  

//convert the string data to double

 double sales = Convert.ToDouble(Console.ReadLine());

//use described algorithm to calculate the payment

 double payment = 200 + (sales*0.09);

//show the value in console

 Console.Write("total payment for this week is: "+payment);

}

}

6 0
3 years ago
the ____ presents information about the document, the progress of current tasks, and the status of certain commands and keys.​
emmasim [6.3K]
The task bar in all programmes 
5 0
3 years ago
Other questions:
  • )How to extract a specific element of item in a list?
    13·1 answer
  • Which one is not the future of wireless technology?
    8·1 answer
  • What is an online reputation?
    12·2 answers
  • A newly opened law firm in Kirkland decides to create a small website that provides a brief introduction of the firm, its missio
    8·1 answer
  • Briley has all the hardware she needs to construct a fully functional personal computer. She connects the various components and
    7·1 answer
  • 4.2 lesson practice last one plzs help
    5·2 answers
  • What dd command would you use to copy the contents of a partition named /dev/drive1 to another partition, called /dev/backup?
    6·1 answer
  • Please help thank u!!!!!
    13·2 answers
  • Can you anyone please help me​
    13·1 answer
  • Web résumés allow you to include extra graphics and images that you would not include in a traditional résumé. Please select the
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!