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
kolbaska11 [484]
3 years ago
11

Array testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full cre

dit is 100, so anything over 100 is extra credit. Ex: If testGrades = {101, 83, 107, 90}, then sumExtra = 8, because 1 + 0 + 7 + 0 is 8.
Computers and Technology
1 answer:
Tresset [83]3 years ago
5 0

Answer: The program in c++ language for the given scenario is given below.

#include <iostream>

using namespace std;

int main() {    

int sumExtra = 0, len;

int testGrades[len];

// this input determines the length of the array

cout<<"Enter the number of grades to be entered : ";

cin>>len;

 

for(int j=0; j<len; j++)

{

    cout<<endl<<"Enter grade "<<j+1;

    cin >> testGrades[j];

}

 

for(int i=0; i<len; i++)

{

    if(testGrades[i] > 100)

        sumExtra =  sumExtra + ( testGrades[i] - 100 );

    else

        continue;

}

cout<<endl<<"Sum of extra credit = " << sumExtra;

return 0;

}

Explanation:

Header files are imported for input/ output alongwith the namespace.

#include <iostream>

using namespace std;

All variables and array is declared of type integer.

int sumExtra = 0, len;

int testGrades[len];

User is prompted for the number of grades to be entered. This number is stored in variable len, which determines the length of the array, testGrades.

testGrades[len];

Using for loop, grades are entered for each index.

for(int j=0; j<len; j++)

{

     cout<<endl<<"Enter grade "<<j+1;

     cin >> testGrades[j];

}

Using another for loop and if-else statement, if the grade > 100, extra credit is added and sum is stored in the variable, sumExtra.

for(int i=0; i<len; i++)

{

     if(testGrades[i] > 100)

          sumExtra =  sumExtra + ( testGrades[i] - 100 );

     else

          continue;

}

This is followed by displaying the message with sum of the extra credit.

The main() function has the return type int. Hence, integer 0 is returned at the end of the program.

In the above, endl keyword is used to insert break line. The following message will be displayed on the new line. This is another alternative for the newline character, \n.

The given program does not implements a class since the logic is simple. Also, the question does not specify that the class and object should be used.

You might be interested in
Consider the scenario below. Will the solution attempted by the technician fix the problem or make it worse? Defend your answer.
vampirchik [111]

1. At Work--and at Play

At the 2005 E3 trade show, the big news was the extreme capabilities of the next Xbox and PlayStation consoles--these machines will more closely resemble home media computers rather than game devices. And with flat-screen monitors that double as TVs and cell phones that double as PDAs and MP3 players, the convergence of tech for work and play may reach a crescendo in the next few years.

What does this mean for your business? Maybe you'll return to the heady dotcom days and offer your employees a game console for break times. After all, you can also use it to play back video and digital photos in meetings. And a cell phone that plays music could be handy in traffic, but one that plays MP3s of the latest business audio book can also keep you informed on the go. So don't pooh-pooh the latest consumer devices as having no potential for business use--with a little imagination, you can mix business and fun.

2. Prepare to Get Mini

The mini computer packs a full-fledged PC into a package the size of a laptop battery, and can be used at your desk or as a portable computer--they're smaller than the slimmest laptops, and they don't have the limited capability of a PDA. And they come equipped with all processing power, memory and ports you'd expect in a regular computer, minus the bulk and weight. Some have docking cradles and can be used as tablets, while others feature slide out screens, but they're all small enough to be able to slip into a purse or pocket. Unfortunately, they're still cost prohibitive: A mini PC can cost as much as $4,000, whereas a regular computer with the same processing power can be purchased for less than $500. At this point, mini PCs are really a fashion statement for the ultimate early adopter, but keep your eyes peeled because once prices drop, they could change the way that everyone does business out of the office.

3. Next Gen Cell Phones

3G, or third-generation, cell phone networks are popping up all across the country. And they're not just for making phone calls. Current releases offer a variety of capabilities, including on-demand video services that let you watch streaming video clips on your phone, built-in camcorders that record video, still cameras to snap pix, MP3 players to play your favorite music, and mini SD cards, Memory Sticks or Multimedia Memory Cards to save and transfer it all between devices. 3G Smartphones sport mini keyboards to save your thumb from cramping up during marathon text message sessions, feature Windows Mobile OS and can be Bluetooth or Wi-Fi-enabled. GPS-equipped cell phones also just made their debut. Use them to get driving directions while on the road or to keep track of employees.

4. Inventory Gets Smart

Radio Frequency Identification (RFID) embeds tiny data-packed radio transceiver chips into all kinds of goods and containers. Like a talking bar code, an RFID chip can talk to a scanner several feet away and tell it far more than a printed label, even from inside an unopened carton. The technology has been around for decades, but has only recently come into use. The Department of Defense and Wal-Mart are already taking advantage of RFID. Once pricing gets friendlier and some standards are worked out, the technology will trickle down to smaller retailers and businesses.

"When transportation companies begin reading carton and pallet tags as shipments are loaded, transferred and delivered, this could provide smaller retailers with the same level of tracking that UPS and FedEx provide," says Bert Moore, director of IDAT Consulting and Education, a Pittsburgh technology consulting firm. "Better tracking will allow managers to better schedule work flow and inventory."

3 0
3 years ago
Which of the file names below follows standard file naming convention?
Alexxandr [17]

The answer is B: BUS-APP_QUZ_CH02_V01

A file naming convention is a method for naming files in a systematic way. Naming files consistently and in a logical way will facilitate storage and retrieval of data. There are various standard naming conventions that should be followed. One is to always use capital letters to delimit words. Do no use  spaces and try not to make the file names too long. Most operating systems will recognize underscores and dashes and not recognize special characters such as / ! @ # $ % so avoid them. Names should also not be separated and thus, only option B meets the above criteria.  

4 0
3 years ago
Read 2 more answers
Select all the correct answers<br> Which TWO statements describe the functions of wireless media?
LenKa [72]

The two functions are :

- used for network connectivity on cell phones, iPads, and laptops.

- data is carried through radio, infrared and microwave signals.

What is wireless media ?

- Unguided media or unbounded transmission media are other names for wireless communication.

- The transmission of electromagnetic signals in this form is not dependent on any physical medium. When communicating wirelessly, we can send our message by infrared, radio, or microwave waves through the air, water, or vacuum.

Therefore, functions of wireless media include network connectivity on cell phones, iPads, and laptops and radio, infrared and microwave signals to carry data.

You can learn more about wireless media from the given link:

https://brainly.in/question/12459910

#SPJ13

5 0
2 years ago
Java Programming home &gt; 1.14: zylab training: Interleaved input/output Н zyBooks catalog Try submitting it for grading (click
Andru [333]

Answer:

The following are the code to this question:

code:

System.out.println(x);  //use print method to print value.

Explanation:

In the given question, it simplifies or deletes code in the 11th line. This line has a large major statement.  

In the case, the tests fail because only 1 line of output is required by the tester, but two lines are obtained instead.

It's to demonstrate that the input/output or testing requirements function throughout the model.

5 0
4 years ago
A relative path name defines a path from_________________________ Select one: a. from the UFD (user file directory) b. the curre
lorasvet [3.4K]

Answer:

(b)  the current directory

Explanation:

A path is the location or route to a particular file or folder in an operating system. This path is always unique and can either be relative or absolute.

A relative path name of a file defines the path to the file from the current or present working directory.

An absolute path name of a file defines the path to the file from the root directory. This path gives a complete descriptive path to a file from the start of the actual file system of the operating system.

4 0
3 years ago
Other questions:
  • Which of the following is a reason photographing animals can be difficult?
    9·2 answers
  • In a cellular network, where does each wireless base station connect to?
    9·1 answer
  • What does limited access to a document mean? A. It makes a document inaccessible without a password. B. It enables a person to m
    7·1 answer
  • What is blockchain? How it works? I heard bitcoin uses it.
    8·1 answer
  • Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored
    12·1 answer
  • What is better apple or andriod
    11·2 answers
  • Academic databases are the best place to look for
    12·1 answer
  • 2. Sherry bought the following articles
    7·1 answer
  • Is social media bringing people together or cause in sepretation?​
    11·2 answers
  • How does a fully integrated Data and Analytics Platform enable organizations to convert data into consumable information and ins
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!