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
vladimir2022 [97]
3 years ago
14

Write a user-defined function that calculates the GPA. For the function name and arguments, use the following: The input argumen

t g is a vector whose elements are the numerical values of the grades. The input argument h is a vector with the corresponding credit hours. The output argument GPA is the calculated GPA. Use the function to calculate the GPA for a student with the following record
Computers and Technology
1 answer:
QveST [7]3 years ago
7 0

Answer:

#include <iostream>

#include <vector>

using namespace std;

void calGPA();

vector<int> g;

vector<int> h;

int main(){

   char pushMore = 'y';

   int fg, fh;

   for (;;){

       if (pushMore == 'n'){

           break;

       } else{

           cout<< "Enter integer for grade: ";

           cin>> fg;

           cout<< "Enter integer for credit hours: ";

           cin>> fh;

           g.push_back(fg);

           h.push_back(fh);

           cout<< "Do you want to add more grade and credit hours? y/n: ";

           cin>> pushMore;

       }

   }

   calGPA();

}

void calGPA(){

   double total = 0, GPA;

   for (int i = 0; i < g.size(); ++i) {

        total +=  g.at(i) * h.at(i) ;

   }

   cout<< "The GPA is : "<< total/g.size();

}

Explanation:

The C++ source code above defines two vectors 'g' and 'h'. The latter holds the grades of a student while the former holds the credit hours for the subject taken. The void 'calGPA' function calculates and prints the student's GPA.

You might be interested in
Name at least two types of career options that are available for someone with strong typing skills?
lesantik [10]
Receptionists & data entry
5 0
3 years ago
Read 2 more answers
When looking to ensure your website is easily accessible by mobile users, what should you focus on doing first
antoniya [11.8K]

Answer:

There are may steps in this procedure but there few steps that do first to access your mobile with your website.

Explanation:

When we are looking in our website and easily accessed by the mobile users, It is easy for them.

There are certain steps that should do first.

  • First step is that you have to redesign the website color scheme
  • To optimize your website
  • To create the mobile app
  • Now to shorten the content in website.

6 0
3 years ago
(Technical terms) The classification computer into five distinct phases.​
vladimir2022 [97]

Answer:

Computing is any goal-oriented activity requiring, benefiting from, or creating computers. It includes development of both hardware and software. Computing has become a critical, integral component of modern industrial technology. Major computing disciplines include computer engineering, computer science, cybersecurity, data science, information systems, information technology and software engineering

<em>《</em><em>please</em><em> </em><em>mark</em><em> </em><em>as</em><em> </em><em>brainlist</em><em>》</em>

4 0
3 years ago
Define operating system?explain the types of operating system on the basis of use.​
GalinKa [24]

Answer:

An operating system is a software that helps the any computers basic needs or functions.  For example, the windows on a computer is a operating system.

Explanation:

4 0
2 years ago
The __________ is a worldwide collection of networks that links millions of businesses, govenment agencies, educational institut
Vlad [161]
<span>The INTERNET is a worldwide collection of networks that links millions of businesses, government agencies, educational institutions, and individuals.</span>
5 0
3 years ago
Other questions:
  • W jakim celu powstawały pieśni żołnierskie i partyzanckie?
    10·1 answer
  • You're creating a table for one of your slides, and need to make some modifications to your table structure. Which of the follow
    14·1 answer
  • How can you check an orthographic drawing to be sure there are no missing lines
    5·2 answers
  • Which best explains what a credit score represents
    10·2 answers
  • In general terms, a program that is broken into smaller units of code such as methods, is known as a ________
    6·1 answer
  • Write a Temperature class that will hold a temperature in Fahrenheit, and will provide methods to get and display the temperatur
    5·1 answer
  • What is the purpose of the .NET Framework Class Library? a. it provides pre-written code that can be used by .NET applications b
    13·1 answer
  • Which of the following is NOT one of the Big 3 Google Applications that we discussed?
    9·2 answers
  • Which of these are characteristics of a Python data type? Check all that apply.
    11·1 answer
  • Choose a problem that lends to an implementation that uses dynamic programming. Clearly state the problem and then provide high-
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!