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
11111nata11111 [884]
3 years ago
7

Your program must output each student’s name in the form: last name followed by a comma, followed by a space, followed by the fi

rst name; the name must be left justified. Moreover, other than declaring the variables and opening the input and output files, the function main should only be a collection of function calls.
Engineering
1 answer:
Reptile [31]3 years ago
3 0

Answer:

#include <iostream>

#include <string>

#include <fstream>

using namespace std;

char getStudentGrade(int testScore);

//Declare constant max students in file 10

const int maxStudents = 10;

struct StudentType

{

  string studentFName;

  string studentLName;

  int testScore;

  char grade;

};

void readStudentData(StudentType students[]){

  int i = 0;

 

  ifstream infile;

  infile.open("inputStudentData.txt");

 

 

  while (!infile.eof())

  {

   infile >> students[i].studentFName;

   infile >> students[i].studentLName;

   infile >> students[i].testScore;

   students[i].grade = getStudentGrade(students[i].testScore);

      i++;

  }

}

char getStudentGrade(int testScore){

  char grade;

  if(testScore >= 80) {

      grade = 'A';      

  }

  else if(testScore >= 60) {

      grade = 'B';

  }

  else if(testScore >= 50) {

      grade = 'C';  

  }

  else if(testScore >= 40) {

      grade = 'D';      

  }

  else {

      grade = 'F';  

  }

  return grade;

}

int main()

{

 

  StudentType students[10];

 

  readStudentData(students);

 

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

      students[i].grade = getStudentGrade(students[i].testScore);

  }

 

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

      cout << students[i].studentLName <<", " << students[i].studentFName << " " << students[i].grade << endl;

  }

  ofstream outputFile;

  outputFile.open ("outputStudentData.txt");

 

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

      outputFile << students[i].studentLName <<", " << students[i].studentFName << " " << students[i].grade << endl;

  }

  outputFile.close();

  return 0;

}

You might be interested in
B)<br>State the essential difference between a plain carbon steel<br>and an alloy steel​
choli [55]

Answer:

Plain carbon steel has no or trace external elements while alloy steel has high amount of other elements.

Explanation:

Plain carbon steel has no or trace amount of other elements while alloy steel has high amount of other elements in their composition.

The presence of other elements in alloy steel improvise several physical properties of the steel while plain carbon steel has the basic properties.

6 0
3 years ago
How to design a solar panel<br>​
artcher [175]

Answer:

#1) Find out how much power you need

#2 Calculate the amount of batteries you need.

#3 Calculate the number of solar panels needed for your location and time of year.

#4 Select a solar charge controller.

#5 Select an inverter.

#6 Balance of system

Explanation: To design solar panel, consider the following steps

1.) Find the power consumption demands

The first step in designing a solar PV system is to find out the total power and energy consumption of all loads that need to be supplied by the solar PV system as follows:

Calculate total Watt-hours per day for each appliance used.

 Add the Watt-hours needed for all appliances together to get the total Watt-hours per day which must be delivered to the appliances.

Calculate total Watt-hours per day needed from the PV modules.

Multiply the total appliances Watt-hours per day times 1.3 (the energy lost in the system) to get the total Watt-hours per day which must be provided by the panels.

2. Size the PV modules

Different size of PV modules will produce different amount of power. To find out the sizing of PV module, the total peak watt produced needs. The peak watt (Wp) produced depends on size of the PV module and climate of site location. We have to consider panel generation factor which is different in each site location. For Thailand, the panel generation factor is 3.43. To determine the sizing of PV modules, calculate as follows:

2.1 Calculate the total Watt-peak rating needed for PV modules

Divide the total Watt-hours per day needed from the PV modules (from item 1.2) by 3.43 to get the total Watt-peak rating needed for the PV panels needed to operate the appliances.

Calculate the number of PV panels for the system

Divide the answer obtained in item 2.1 by the rated output Watt-peak of the PV modules available to you. Increase any fractional part of result to the next highest full number and that will be the 

number of PV modules required.

Result of the calculation is the minimum number of PV panels. If more PV modules are installed, the system will perform better and battery life will be improved. If fewer PV modules are used, the system may not work at all during cloudy periods and battery life will be shortened.

3. Inverter sizing

An inverter is used in the system where AC power output is needed. The input rating of the inverter should never be lower than the total watt of appliances. The inverter must have the same nominal voltage as your battery.

For stand-alone systems, the inverter must be large enough to handle the total amount of Watts you will be using at one time. The inverter size should be 25-30% bigger than total Watts of appliances. In case of appliance type is motor or compressor then inverter size should be minimum 3 times the capacity of those appliances and must be added to the inverter capacity to handle surge current during starting.

For grid tie systems or grid connected systems, the input rating of the inverter should be same as PV array rating to allow for safe and efficient operation.

4. Battery sizing

The battery type recommended for using in solar PV system is deep cycle battery. Deep cycle battery is specifically designed for to be discharged to low energy level and rapid recharged or cycle charged and discharged day after day for years. The battery should be large enough to store sufficient energy to operate the appliances at night and cloudy days. To find out the size of battery, calculate as follows:

     4.1 Calculate total Watt-hours per day used by appliances.

     4.2 Divide the total Watt-hours per day used by 0.85 for battery loss.

     4.3 Divide the answer obtained in item 4.2 by 0.6 for depth of discharge.

     4.4 Divide the answer obtained in item 4.3 by the nominal battery voltage.

     4.5 Multiply the answer obtained in item 4.4 with days of autonomy (the number of days that you need the system to operate when there is no power produced by PV panels) to get the required Ampere-hour capacity of deep-cycle battery.

Battery Capacity (Ah) = Total Watt-hours per day used by appliancesx Days of autonomy

(0.85 x 0.6 x nominal battery voltage)

5. Solar charge controller sizing

The solar charge controller is typically rated against Amperage and Voltage capacities. Select the solar charge controller to match the voltage of PV array and batteries and then identify which type of solar charge controller is right for your application. Make sure that solar charge controller has enough capacity to handle the current from PV array.

For the series charge controller type, the sizing of controller depends on the total PV input current which is delivered to the controller and also depends on PV panel configuration (series or parallel configuration).

According to standard practice, the sizing of solar charge controller is to take the short circuit current (Isc) of the PV array, and multiply it by 1.3

Solar charge controller rating = Total short circuit current of PV array x 1.3

5 0
3 years ago
Water is pumped steadily through a 0.10-m diameter pipe from one closed pressurized tank to another tank. The pump adds 4.0 kW o
jekas [21]

Complete Question

Complete Question is attached below.

Answer:

V'=5m/s

Explanation:

From the question we are told that:

Diameter d=0.10m

Power P=4.0kW

Head loss \mu=10m

 \frac{P_1}{\rho g}+\frac{V_1^2}{2g}+Z_1+H_m=\frac{P_2}{\rho g}+\frac{V_2^2}{2g}+Z_2+\mu

 \frac{300*10^3}{\rho g}+35+Hm=\frac{500*10^3}{\rho g}+15+10

 H_m=(\frac{200*10^3}{1000*9.8}-10)

 H_m=10.39m

Generally the equation for Power is mathematically given by

 P=\rho gQH_m

Therefore

 Q=\frac{P}{\rho g H_m}

 Q=\frac{4*10^4}{1000*9.81*10.9}

 Q=0.03935m^3/sec

Since

 Q=AV'

Where

 A=\pi r^2\\A=3.142 (0.05)^2

 A=7.85*10^{-3}

Therefore

 V'=\frac{0.03935m^3/sec}{7.85*10^{-3}}

 V'=5m/s

5 0
3 years ago
technician a says that dirt bypassing the filter on many common rail injectors can cause an injector to stick open and continuou
NNADVOKAT [17]

Technician a is correct because he says that Many common rail injectors filters can be bypassed by dirt, which can lead to an injector sticking open and continuously fueling a cylinder.

Coalescence is used to separate the water and fuel. To the fuel injector cleaning kit, fasten your air compressor. Diesel engines run at compression ratios that are greater than those of gasoline engines. greater ratio compared to gasoline engines. increased thermal expansion as a result. more fuel energy that is transformed into usable power. The great benefit of using a dry cylinder sleeve is that by quickly installing new sleeves, the cylinder block can be quickly restored to its original specifications. Vacuum drying can be used to get rid of small amounts of water. A nozzle is used to spray the fuel into the vacuum chamber of engines. Air and unsolved free water are taken out of the oil. The fuel is evenly dispersed, which facilitates efficient drying.

Learn more about injectors here:

brainly.com/question/27969202

#SPJ4

3 0
10 months ago
Air enters the 1 m² inlet of an aircraft engine at 100 kPa and 20° C with a velocity of 180 m/s. Determine: a) The volumetric fl
Shkiper50 [21]

Answer:

a) 180 m³/s

b) 213.4 kg/s

Explanation:

A_1 = 1 m²

P_1 = 100 kPa

V_1 = 180 m/s

Flow rate

Q=A_1V_1\\\Rightarrow Q=1\times 180\\\Rightarrow Q=180\ m^3/s

Volumetric flow rate = 180 m³/s

Mass flow rate

\dot{m}=\rho Q\\\Rightarrow \dot m=\frac{P_1}{RT} Q\\\Rightarrow \dot m=\frac{100000}{287\times 293.15}\times 180\\\Rightarrow \dotm=213.94\ kg/s

Mass flow rate = 213.4 kg/s

3 0
3 years ago
Other questions:
  • A 55-μF capacitor has energy ω (t) = 10 cos2 377t J and consider a positive v(t). Determine the current through the capacitor.
    12·1 answer
  • What is the rms current flowing through a light bulb that uses an average power of 60.0 60.0 W when it is plugged into a wall re
    12·1 answer
  • Input Energy ---&gt; Output Energy
    8·1 answer
  • One of the best ways to find a vacuum leak on a speed-density fuel-injection system is to read the intake air controller (LAC) c
    12·2 answers
  • Zionjasean17 zionjasean17
    8·2 answers
  • When you do a vehicle check, what do you NOT need to keep an eye on?
    9·1 answer
  • What is the output of the following program fragment. Choose appropriate data-types of variables to match output.
    10·1 answer
  • 3
    6·1 answer
  • Their game off badminton is always on Tuesday
    11·1 answer
  • The southernmost rim inlet elevation on the topographical survey is
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!