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
Name the sections of an instruction.
topjm [15]
Instruction in memory has two parts: opcode and operands. The operands are subjects of the operation, such as data values, registers, or memory addresses. Due to variety of opcodes and operands, instructions may occupy different sizes of bytes in memory
3 0
3 years ago
Need help with these
kolbaska11 [484]
The first one is d the second one is true the third one is false
3 0
3 years ago
What coding language should i begin with if i'm looking to get into AI ?
loris [4]

Depends really. Have you got prior coding experience? The semantics of certain languages are much easier to pick up if you've had prior experience, but it might seem impossible to someone who has minimal experience.

Assuming that you're no older than 15 or 16, I'm going to suggest Python. It's a simple, high-level language that's easier to understand than most languages. If you think you've got enough experience to quickly understand and pick up things, then I'd probably say R is a good language to start with. It's very well-suited for AI and tends to be a favourite for AI researchers.

7 0
3 years ago
What the benefits of folder when working with files
sasho [114]
It helps to keep things organized
3 0
4 years ago
Read 2 more answers
PLEASE HELP!!!
tino4ka555 [31]

Answer:

C or D

Explanation:

If he has previous experience, C might be better answer, otherwise, D is right.

not sure with my answer either lol

6 0
3 years ago
Other questions:
  • The procedure call mystery(38) will yield which output? __________ a) 0 12 b) 12 0 c) 1 1 0 2 d) 1 1 1 1 e) 2 0 1 1 public void
    11·1 answer
  • What is the least number of bits you would need to borrow from the network portion of a Class B subnet mask to get at least 130
    10·1 answer
  • Samantha wants to create a network group that allows open sharing of data without restrictions. What type of network should she
    9·1 answer
  • Write a program in Python that reads in investment amount, annual interest rate, and number of years, and displays the future in
    6·1 answer
  • What does it mean by MYRIAD of data?
    9·1 answer
  • How to learning algothrim bett
    5·1 answer
  • What is the data and information with example? ​
    9·1 answer
  • Last bittttt of points
    8·1 answer
  • Write an algorithm (pseudo-code) that takes an unsorted list of n integers and outputs a sorted list of all duplicate integers.
    6·1 answer
  • Write a program that allows the user to enter their name from the keyboard. Allow the user to pick how many times they want thei
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!