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
never [62]
3 years ago
15

Write a C++ program to store 10 student names and grade point averages (GPAs) from the user. Display all student information in

a tabular format. Ensure that each column heading aligns correctly with its respective column and that each name (first and last) is capitalized. Finally, display each GPA with two significant decimals
Computers and Technology
1 answer:
Aleksandr-060686 [28]3 years ago
6 0

Answer:

Answer to this question is given below in the explanation section.

Explanation:

 

#include <iostream>

#include<iomanip>

#include <string>

#include <cctype>

using namespace std;

int main()

{

   string firstName[10], lastName[10];//variable declaration

   double gpa[10];

   for(int i=0; i<10;i++)//loop for entering 10 students record

   {  

       cout<<"Enter data for student: "<<i+1;//start from 1

       cout<<"\nEnter First Name: ";

       cin>>firstName[i];

       cout<<"Enter Last Name: ";

       cin>>lastName[i];

       cout<<"Enter the GPA: ";

       cin>>gpa[i];

   }

  cout<<"\n*********************************************************************";

  cout<<"\n"<<setw(30)<<"Student Data";//setw set the space to 30

  cout<<"\n*********************************************************************";

  cout<<"\n";

  cout<<setw(10)<<"First Name"<<setw(25)<<"Last Name"<<setw(25)<<"GPA";//display column header

  for(int i=0; i<10; i++)//display student entered record

  {

      cout<<"\n"<<setw(10)<<firstName[i]<<setw(25)<<lastName[i]<<setw(25)<< setprecision(3)<<gpa[i];//setprecision function set the decimal limit to 2

  }

  cout<<"\n*********************************************************************";

  cout<<"\n"<<setw(30)<<"Finished";

  cout<<"\n*********************************************************************";

   

   

   return 0;

}

                                                                                                                                                                                                                                                             

You might be interested in
When should you use an electronic spreadsheet
nadezda [96]

Answer:

An electronic spreadsheet can be used to perform numerical calculations automatically

Explanation:

An electronic spreadsheet can be used to perform numerical calculations automatically. This spreadsheets are set up in the form of a table with rows and columns.

Data is stored in a cell formed as a result of intersection of each row and column.

Their primary purpose is to organize and categorize data into a logical format. This data then can be used to organize and grow the business.

6 0
3 years ago
Privacy settings allow account owners to decide who can ........
schepotkina [342]
Have access to your phone info
4 0
3 years ago
Read 2 more answers
TTrOTSTE<br>1,5,10,17,......20th series plz help me to do this question (qbasic qs)​
Svetradugi [14.3K]

Answer:

try counting how many numbers there are to get to 5 which would be 4 then count how many numbers there to get 10 which is 5 and so on

7 0
3 years ago
Kieran wants to search a database quickly for information on the last time a patient came to his medical facility. This informat
SpyIntel [72]
B I think is what it is
7 0
3 years ago
Read 2 more answers
What are the letters associated with home rows keys?​
bulgar [2K]

Answer:

The letters are 'a s d f g h j k l ;' .These are the letters associated with the home keys.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Heelp my brainly stuff says i am 49 but im 11 how to fix?X??
    7·1 answer
  • Write a function named "higher_lower" that takes an int as a parameter and returns "higher" if 14 is greater than the input and
    11·1 answer
  • What are the Typical application<br>of mini computer​
    5·2 answers
  • In an all-integer linear program,
    10·1 answer
  • Which of the following is not a natural resource
    11·2 answers
  • A mysql prompt has been opened for you. Using the college database, complete the following tasks (use either a single-line or a
    7·1 answer
  • In critical thinking, an argument is:
    12·2 answers
  • What's up with this new update?
    13·2 answers
  • Need help with this one​
    5·1 answer
  • What is another name for control structure <br> Object<br> Sequence<br> Loop<br> Decision
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!