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
ratelena [41]
3 years ago
10

The attached program (studentsGpa.cpp) uses dynamic allocation to create an array of strings. It asks the user to enter a number

and based on the entered number it allocates the array size. Then based on that number it asks the user that many times to enter student’s names. What you need to do:Add another array of doubles to store the gpa of each student as you enter themYou need to display both the student’s name and the gpa.NOTE: must use pointer notation not array subscript. Any submission that uses array subscript won’t be graded

Engineering
1 answer:
Arisa [49]3 years ago
5 0

Question: The program was not attached to your question. Find attached of the program and the answer.

Answer:

See the explanation for the answer.

Explanation:

#include <iostream>

using namespace std;

int main()

{

   cout << "How many students will you enter? ";

   int n;

   cin>>n;

   string *name = new string[n];

   double *gpa = new double[n];

   for(int i=0;i<n;i++){

       cout<<"Enter student"<<(i+1)<<"'s name: ";

       cin>>name[i];

       cout<<"Enter student"<<(i+1)<<"'s gpa: ";

       cin>>gpa[i];

   }

   cout<<"The list students"<<endl;

   cout<<"Name             GPA"<<endl;

   cout<<"----------------------"<<endl;

   for(int i=0;i<n;i++){

       cout<<name[i]<<"              "<<gpa[i]<<endl;

   }

   return 0;

}

OUTPUT : See the attached file.

You might be interested in
Describe the medium/long-range transportation options available to people prior
lakkis [162]

Answer:

answer below:

Explanation:

Before the Industrial Revolution, transportation relied on animals (like horses pulling a cart) and boats. Travel was slow and difficult. It could take months to travel across the United States in the early 1800s before industrial revolution

The Industrial Revolution completely changed the way people traveled and how goods were transported.

the problem of traveling upstream was solved during the industrial revolution by the steam engine. in order to make better use of water transportation, canals were build to connect rivers, lakes and oceans. the invention of the railroad and the steam powered locomotive opened up a whole new world in transportation. even with steamboats and railroads, people still needed a better wat to travel between rivers and train stations. a new process called the "macadam " process was used to create smooth gravel roads

I hope this helps a bit.

3 0
2 years ago
Suppose a large amount of power is required. Which engine would you choose between Otto and Diesel? Why?
Firdavs [7]

Answer:

Otto engine

Explanation:

As we know that

Power = Torque x speed

So we can say that when speed of engine then power of engine also will increases.

The speed of Otto engine is more as compare to Diesel engine so the power of Otto engine is more.But on the other hand torque of Diesel engine is more as compare to Otto engine but the speed is low so the product of speed and torque is more for Otto engine .It means that when requires large amount of power then Otto engine should be use.

6 0
3 years ago
Astronauts who landed on the moon during the Apollo 15, 16, and 17 missions brought back a large collection of rocks to the eart
stiks02 [169]

Answer: a) W(earth) = 935.62 lbs

b) Mass of rocks in slugs = 29.06 slugs

Explanation:

a) From Newton's law, W = mg. Whether on the moon or on earth. Although, the mass of the rocks everywhere is the same, that is, mass of rocks on the moon = mass of rocks on earth.

W(moon) = mg(moon)

W(moon) = 154 lbs

g(moon) = 5.30 ft/s2

m = W(moon)/g(moon) = 154/5.3 = 29.06 lb.s2/ft

W(earth) = m g(earth)

g(earth) = 32.2 ft/s2

W(earth) = 29.06 × 32.2 = 935.62 lbs.

b) A slug = 1 lb.s2/ft, therefore the mass of the rocks in slugs is 29.06 slugs.

QED!

8 0
3 years ago
A 3-in-thick slab is 10 in wide and 15 ft long. The thickness of the slab is reduced by 20% and width increases by 3% in a hot-r
xxMikexx [17]

Answer: l = 2142.8575 ft

v = 193.99 ft/min.

Explanation:

Given data:

Thickness of the slab = 3in

Length of the slab = 15ft

Width of the slab = 10in

Speed of the slab = 40ft/min

Solution:

a. After three phase

three phase = (0.2)(0.2)(0.2)(3.0)

= 0.024in.

wf = (1.03)(1.03)(1.03)(10.0)

= 10.927 in.

Using constant volume formula

= (3.0)(10.0)(15 x 15) = (0.024)(10.927)Lf

Lf = (3.0)(10.0)(15 x 15)/(0.024)(10.927)

= 6750 /0.2625

= 25714.28in = 2142.8575 ft

b.

vf = (0.2 x 0.2 x 3.0)(1.03 x 1.03 x 10.0)(40)/(0.024)(10.927)

= (0.12)(424.36)/0.2625

= 50.9232/0.2625

= 193.99 ft/min.

4 0
3 years ago
Implement the function lastChars() that takes a list of strings as a parameter and prints to the screen the last character of ea
Liono4ka [1.6K]

Answer:

The following program is in C++.

#include <bits/stdc++.h>

using namespace std;

void lastChars(string s)

{

   int l=s.length();

   if(l!=0)

   {

       cout<<"The last character of the string is: "<<s[l-1];

   }

}

int main() {

   string s;//declaring a string..

   getline(cin,s);//taking input of the string..

   lastChars(s);//calling the function..

return 0;

}

Input:-

Alex is going home

Output:-

The last character of the string is: e

Explanation:

In the function lastChars() there is one argument that is a string.I have declared a integer variable l that stores the length of the string.If the length of the string is not 0.Then printing the last character of the string.In the main function I have called the function lastChars() with the string s that is prompted from the user.

8 0
3 years ago
Other questions:
  • What is the composition, in atom percent, of an alloy that consists of 4.5 wt% Pb and 95.5 wt% Sn?
    13·1 answer
  • Go online and search for information about companies that have been harmed or bankrupted by a disaster. Choose one such company
    11·1 answer
  • A sheet of steel 3-mm thick has nitrogen atomospheres on both sides at 900 C and is permitted to achieve a steady-state di usion
    6·1 answer
  • Consider the gas carburizing of a gear of 1018 steel (0.18 wt %) at 927°C (1700°F). Calculate the time necessary to increase the
    12·1 answer
  • What's the best way to find the load capacity of a crane? Select the best option. Call the manufacturer Ask co-workers Look at t
    8·1 answer
  • What is 7-?=4 i need help
    9·2 answers
  • An aggregate blend is composed of 65% coarse aggregate by weight (Sp. Cr. 2.635), 36% fine aggregate (Sp. Gr. 2.710), and 5% fil
    5·1 answer
  • What is the difference between digital instruments and decimal scaled instruments to measure
    6·1 answer
  • WHICH TASK BEST FITS THE ROLE OF A DESIGN ENGINEER ?
    7·1 answer
  • A TV USE 75 WATTS WHILE IN USED ASSMING THAT ITIS USED 4 HOURS EVERY DAY HOW MUCH ENERGY IN 4 IN KWH WOULD THE TV CONSUME ANNUAL
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!