Exercise 4: Bring in program grades.cpp and grades.txt from the Lab 10 folder. Fill in the code in bold so that the data is properly read from grades.txt. and the desired output to the screen is as follows: OUTPUT TO SCREEN DATAFILE Adara Starr has a(n) 94 average Adara Starr 94 David Starr has a(n) 91 average David Starr 91 Sophia Starr has a(n) 94 average Sophia Starr 94 Maria Starr has a(n) 91 average Maria Starr 91 Danielle DeFino has a(n) 94 average Danielle DeFino 94 Dominic DeFino has a(n) 98 average Dominic DeFino 98 McKenna DeFino has a(n) 92 average McKenna DeFino 92 Taylor McIntire has a(n) 99 average Taylor McIntire 99 Torrie McIntire has a(n) 91 average Torrie McIntire 91 Emily Garrett has a(n) 97 average Emily Garrett 97 Lauren Garrett has a(n) 92 average Lauren Garrett 92 Marlene Starr has a(n) 83 average Marlene Starr 83 Donald DeFino has a(n) 73 average Donald DeFino 73

Answers

Answer 1

Answer:

Here is the C++ program:

#include <fstream>  //to create, write and read a file

#include <iostream>  // to use input output functions

using namespace std;  //to access objects like cin cout

const int MAXNAME = 20;  //MAXNAME is set to 20 as a constant

int main(){  //start of main() function

ifstream inData;  //creates an object of ifstream class

inData.open("grades.txt");  //uses that object to access and opens the text file using open() method

char name[MAXNAME + 1];   // holds the names

float average;   //stores the average

inData.get(name,MAXNAME+1);  //Extracts names characters from the file and stores them as a c-string until MAXNAME+1 characters have been extracted

while (inData){  //iterates through the file

 inData >> average;  //reads averages from file using the stream extraction operator

 cout << name << " has a(n) " << average << " average." << endl; //prints the names along with their averages

 inData.ignore(50,'\n');  //ignores 50 characters and resumes when  new line character is reached. It is used to clear characters from input buffer

 inData.get(name,MAXNAME+1);}  //keeps extracting names from file

return 0; }

Explanation:  

The program is well explained in the comments added to each line of the code. The program uses fstream object inData to access the grades.txt file. It gets and extracts the contents of the file using get() method, reads and extracts averages from file using the stream extraction operator. Then program displays the names along with their averages from grades.txt on output screen.

The grades.txt file, program and its output is attached.

Exercise 4: Bring In Program Grades.cpp And Grades.txt From The Lab 10 Folder. Fill In The Code In Bold
Exercise 4: Bring In Program Grades.cpp And Grades.txt From The Lab 10 Folder. Fill In The Code In Bold

Related Questions

On the 80x86 CPU, the ESP register keeps track of the value on the top of the runtime stack.
a) true
b) false

Answers

Answer:

True

Explanation:

The ESP register acts as an indirect operand pointing to the top of the stack at any time.

Stack grows downwards from high memory when a program adds to the stack. However, when items are removed from the stack, it shrinks upwards from low to high memory.

The assembler reduces the stack pointer(ESP) register by 2, when a word value is pushed on to the stack. On the other hand, the assembler increases the stack pointer by 2 when a word value is popped off.

The assembler decreases or increases the ESP register by 4 when a double word value is pushed or popped off the stack respectively. Therefore the ESP register changes in multiples of 4.

explain 10 challenges in the use of ICT​

Answers

There are multiple challenges to the ICT education system, here are a few:

ICT is susceptible to various cyber-threats ICT limits the imagination and observance powerIt also arises various health-related problemsNonverbal communication. Student laziness Less security. Social isolation.The Implementation of ICT is much costly.Increases Unemployment and lack of job security Increases Dominant culture within the workplace

Show the array that results from the following sequence of key insertions using a hashing system under the given conditions: 5, 205, 406, 5205, 8205, 307 (you can simply list the non-null array slots and their contents)

a. array size is 100, linear probing used.
b. array size is 100, quadratic probing used.

Answers

Answer:

a) Linear probing is one of the hashing technique in which we insert values into the hash table indexes based on hash value.

Hash value of key can be calculated as :

H(key) = key % size ;

Here H(key) is the index where the value of key is stored in hash table.

----------

Given,

Keys to be inserted are : 5 , 205, 406,5205, 8205 ,307

and size of the array : 100.

First key to be inserted is : 5

So, H(5) = 5%100 = 5,

So, key 5 is inserted at 5th index of hash table.

-----

Next key to inserted is : 205

So, H(205) = 205%100 = 5 (here collision happens)

Recompute hash value as follows:

H(key) =(key+i) % size here i= 1,2,3...

So, H(205) =( 205+1)%100 = 206%100 = 6

So, key 205 is inserted in the 6th index of the hash table.

----------

Next Key to be inserted : 406

H(406) = 406%100 = 6(collision occurs)

H(406) =(406+1) %100 = 407%100 = 7

So, the value 406 is inserted in 7the index of the hash table.

-----------------

Next key : 5205

H(5205) = 5205%100 = 5(collision)

So, H(5205) = (5205+1)%100 = 6( again collision)

So, H(5205) = 5205+2)%100 = 7(again collision)

So, H(5205) = (5205+3)%100 = 8 ( no collision)

So, value 5205 is inserted at 8th index of the hash table.

-------------

Similarly 8205 is inserted at 9th index of the hash table because , we have collisions from 5th to 8th indexes.

-------------

Next key value is : 307

H(307) = 307%100 = 7(collision)

So, (307+3)%100 = 310%100 = 10(no collision)  

So, 307 is inserted at 10th index of the hash table.

So, hash table will look like this:

Key       index

5         5

205         6

406         7

5205 8

8205 9

307         10

b) Quadratic probing:

Quadratic probing is also similar to linear probing but the difference is in collision resolution. In linear probing in case of collision we use : H(key) = (key+i)%size but here we use H(key) =( key+i^2)%size.

Applying Quadratic probing on above keys:.

First key to be inserted : 5.

5 will go to index 5 of the hash table.

-------

Next key = 205 .

H(205) = 205%100 = 5(collision)

So. H(key)= (205+1^2)%100 = 6(no collision)

So, 205 is inserted into 6th index of the hash table.

--------

Next key to be inserted 406:

So, 406 %100 = 6 (collision)

(406+1^2)%100 = 7(no collision)

So, 406 is moved to 7th index of the hash table.

----------

Next key is : 5205

So, 5205%100 = 5 (collision)

So, (5205+1^2)%100 = 6 ( again collision)

So, (5205+2^2)%100 = 9 ( no collision)

So, 5205 inserted into 9th index of hash table.

-----------

Next key is 8205:

Here collision happens at 5the , 6the , 9th indexes,

So H(8205) = (8205+4^2)%100 = 8221%100 = 21

So, value 8205 is inserted in 21st index of hash table.

--------

Next value is 307.

Here there is collision at 7the index.

So, H(307) = (307+1^2)%100 = 308%100= 8.

So, 307 is inserted at 8the index of the hash table.

Key           Index

5                  5

205                  6

406                  7

5205                9

8205               21

307                   8

Overloaded methods must be differentiated by: Select one: a. method name b. data type of arguments c. method signature d. None of the above

Answers

Answer:

b. data type of arguments

Explanation:

One of the ways to overload a method is using different type of arguments. Let's say we have a method that finds and returns two integer values

public int sumValues(int num1, int num2){

       return num1 + num2;

}

We can overload this method by passing double values as arguments

public double sumValues(double num1, double num2){

       return num1 + num2;

}

In most cases, it is possible to prevent an exception from terminating a program by using the try and except statements. Select one: True False

Answers

Answer:

True

Explanation:

Try and except statements (pseudo code) or try and catch (java, c++, etc)

is for error handing. The try and except "handles errors" If encountered an error, the try and except will try to "handle" the error and let the program continue running.

Write an Enlistee class that keeps data attributes for the following pieces of information: • Enlistee name • Enlistee number Next, write a class named Private that is a subclass of the Enlistee class. The Private class should keep data attributes for the following information: • Platoon number (an integer, such as 1, 2, or 3) • Years of service (also an integer)

Answers

Answer:

function Enlistee( name, number ){

    constructor( ){

      super( ) ;

      this.name= name;

      this.number= number;

      this.Private= ( platoonNumber, yearOfService ) =>{

                             this.platoonNumber = platoonNumber;

                             this.yearOfService = yearOfService;

                             }

     }

}                

Explanation:

In Javascript, OOP ( object-oriented programming) just like in other object oriented programming languages, is used to create instance of a class object, which is a blueprint for a data structure.

Above is a class object called Enlistee and subclass "Private" with holds data of comrades enlisting in the military.

In today’s fast-paced, often "agile" software development, how can the secure design be implemented?

Answers

Answer:

Answered below

Explanation:

The agile approach to software development involves development through the collaborative efforts of integrated and organised teams and users. Nowadays, people follow this approach because it allows for faster deployment, continuous updates as well as flexibility in development.

In the face of this rapid development and deployment, security design can be a challenge to keep up with.

Some steps to implement security in an agile environment include;

- Approaching security implementation in the same agile way as software development.

- Making software developers responsible for secure development and implementation.

- Utilising continuous integration of security practices by integrating security solutions with the development tools.

Which of these is an example of output?
typing on a keyboard
a smartphone ringing
using a mouse
a fingerprint sensor

Answers

Answer:

a smartphone ringing

Explanation:

An output device is a computer hardware that converts data or signals into readable form like text, graphic, audio, video, tactile. Example of output devices are monitor, speaker, printer, projector. A smartphone ringing is a computer hardware because it converts the information into readable form in the form of sound.

Input devices is a computer hardware that sends information to the computer for interaction and control. Examples are mouse, keyboard, fingerprint sensor, scanner e.t.c.

Which of the following is true about the strategy that uses page fault frequency (PFF) to prevent thrashing?
A. A new process may be swapped in if PFF is too low.
B. A new page is allocated to a process if PFF is too high.
C. A page is deallocated from a process if the PFF is too low.
D. All of the above.

Answers

Answer:

The answer is "option B"

Explanation:

Thrashing arises whenever the virtual machine assets of a device are overused, leading to constant paging and page defect, that affects the processing of most programs.  

In the given-question, only choice b is correct because this mechanism can be allocated to avoid the thumping of new pages if PFF is too high by increasing several frames or by removing expulsion frames.

Answer:  

B. A new page is allocated to a process if PFF is too high.

Explanation:

Page fault frequency: In computer science, the term "page fault frequency" is also referred as PFF, and is described as a direct approach that is being utilized to handle thrashing and is considered as the one that tends to use "page-fault frequency concept". However, the problem that is connected with the "thrashing" is the "high-page fault rate" and therefore it is responsible for controlling the "page fault rate". However, if the "page-fault rate" is considerably too high, then it tends to indicate that the process consist of only few frames that is being allocated to it.

I microwaved my phone and this Bluetooth popup won't go away and I can't connect to Bluetooth. Help. I have a Google pixel 3XL I'm no phone expert.​

Answers

Answer:  Why'd you'd Microwave your phone?

Explanation: Ok first don't do that, it can make it explode, and since you did that, it messed up something, you'll have to get it fixed or buy a new one

Hope this helps^^

Answer: C

Explanation:

I just took the test, and i am Smart

The first version of the SMTP protocol was defined in RFC 821. The current standard for SMTP is defined in RFC 5321 considering only RFC 821 what are the main commands of the SMTP protocol?

Answers

Answer:

The following are the explanation for each command, with the SMTP protocol considering only RFC 821.

Explanation:

The key commands of the SMTP protocols which take the RFC 821 into account are as follows:

HELLO -  

A client receives that order to describe himself  

HELP-  

It asks by the receivers to submit the command information as argument  

QUIT -  

It is used to terminate the message.  

-FROM MAIL  

The clients use it to acknowledge the message's sender.  

NOOP -  

The client does not use any procedure to verify the receiver status as required by the receiver's reply form.  

RCPT-  

The user needs it to determine the intended beneficiary.  

SAML-  

It sends or ends the specific mail which is sent to the mailbox or the SAML

RESET-  

The existing email transaction is aborted.  

SEND- The mail to be sent by the recipient's terminal, not its mailbox, is specified.  

TURN-  

It allows the sender to change position and recipients.  

VRFY-  

Verification checks the recipient's address.

 

Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If userValues is {2, 1, 2, 2} and matchValue is 2 , then numMatches should be 3.
Your code will be tested with the following values:
userValues: {2, 1, 2, 2}, matchValue: 2 (as in the example program above)
userValues: {0, 0, 0, 0}, matchValue: 0
userValues: {20, 50, 70, 100}, matchValue: 10
#include
using namespace std;
int main() {
const int NUM_VALS = 4;
int userValues[NUM_VALS];
int i;
int matchValue;
int numMatches = -99; // Assign numMatches with 0 before your for loop
cin >> matchValue;
for (i = 0; i < NUM_VALS; ++i) {
cin >> userValues[i];
}
/* Your solution goes here */
cout << "matchValue: " << matchValue << ", numMatches: " << numMatches << endl;
return 0;
}

Answers

Answer:

add new for each loop:

for (int i : userValues)

   if(i == matchValue) numMatches++;

this goes through every userValue and check if it matches match Value.

if it does, then increment numMatches.

Touch screens are becoming extremely popular input devices for phones and tablets. Assess the value of touch screen devices related to human-computer interaction systems. Identify at least two advantages and two disadvantages of having touch screen devices in the workplace. Support your response by citing a quality resource.

Answers

Answer:

Two advantages of touch screen inputs are; free of hardware input problems and the adaptivity of mobile applications.

Two disadvantages of touch screen inputs are; screen usage and software error.

Explanation:

Touch screen input is a slick application of finger-on-screen interaction with gadgets, that promotes mobility. It cancels the need for hardware input devices, reducing system size and weight.

But with its slickness comes extra memory usage and screen space consumption.

It is possible to force the Hardware Simulator to load a built-in version of chip Xxx. This can be done by:

Answers

Answer:

The answer is "It Specifies the built-in chip in the module header".

Explanation:

The hardware simulator is also an instrument about which the device physical models could be constructed, in the mainframe, which includes a console, a power supply, or multiple sockets for plugging regular modules.

It plays a specific role in the computing system, and it is also essential for each standard module. In the hardware controller, it can be used to launch an integrated Xxx processor version, which can be achieved by listing the built-in chip throughout the module header.

Before creating a brief to design a product, what is needed

Answers

Answer:

A good design brief often begins with some information about the client and what their brand stands for. Including this helps to connect an individual project with the bigger picture. Aim to capture key points about what the company does, how big they are, and what their key products or services are.

Explanation:

A good design brief often begins with some information about the client and what their brand stands for. Including this helps to connect an individual project with the bigger picture. Aim to capture key points about what the company does, how big they are, and what their key products or services are.

Write a program that could find whether the number entered through keyboard is odd or even the program should keep on taking the value till the user ends.

Answers

Answer:

using namespace std;

int main() {

int number;

while (1) {

 cout << "Enter a number: ";

 cin >> number;

 cout << number << " is " << ((number % 2) ? "odd" : "even") << endl;

};

return 0;

}

Explanation:

This is a c++ version. Let me know if you need other languages.

The (number % 2) is the essence of the program. It returns 0 for even numbers, and 1 for odd numbers (the remainder after division by 2).

write a pseudocode thats accept and then find out whether the number is divisible by 5 ​

Answers

Answer:

input number

calculate modulus of the number and 5

compare outcome to 0

if 0 then output "divisible by 5"

else output "not divisible by 5"

Explanation:

The modulo operator is key here. It returns the remainder after integer division. So 8 mod 5 for example is 3, since 5x1+3 = 8. Only if the outcome is 0, you know the number you divided is a multiple of 5.

1.16 LAB: Input: Welcome message Write a program that takes a first name as the input, and outputs a welcome message to that name. Ex: If the input is Pat, the output is:

Answers

Full Question

Write a program that takes a first name as the input, and outputs a welcome message to that name. Ex: If the input is Pat, the output is: Hello Pat, and welcome to CS Online!

Answer:

Python

nname = input("What is your name: ")

print("Hello "+nname+" , and welcome to CS Online!")

Explanation:

The programming ls not stated; However, I'll answer using Python

Python (See bold texts for line by line explanation)

This line prompts the user for input

nname = input("What is your name: ")

This line prints the welcome message

print("Hello "+nname+" , and welcome to CS Online!")

Answer the following
1. Explain the difference between likelihood and probability.
2. Give an example of a set of clusters in which merging based on the closeness of clusters leads to a more natural set of clusters than merging based on the strength of connection (interconnectedness) of clusters.

Answers

Answer:

zero, foresight

Explanation:

figure it out

assume your using a three button mouse. to access the short cut menus you would

Answers

left click then the bar would appear and you click inspect!
hope this helped
please give brainliest <3

________ is the branch of computer science that deals with the attempt to create computers that think like humans.

Answers

Answer:

Artificial Intelligence (AI)

Explanation:

Artificial intelligence is a way of making computers to think critically, or act like humans. It involves the application of computer science and technology to produce critical problem solving device as humans.

It is a welcomed development and well accepted innovation to complement humans in proffering solutions to logical and critical problems. It has various applications in influencing the result or solution to mentally demanding tasks that require high intelligence.

True or false?
FCC Guidelines restrict the amount of RF radiation that can be "leaked" by non-industrial equipment?

Answers

Answer:

True

Explanation:

The Federal communications commission (FCC), is responsible for evaluating the effect of radio frequency and electromagnetic radiations and emissions on the consumers of products which make use of these frequencies and radiation energy. Devices such as cell phones are not allowed to emit radiation higher than a certain safe standard or frequency, set by the Federal communications commission.

The Federal communications commission also provides bulletins and publications that present safety information and guidelines for industries and consumers involved with radio frequency and electromagnetic radiation.

token is 64 bytes long (the 10-Mbps Ethernet minimum packet size), what is the average wait to receive the token on an idle network with 40 stations? (The average number of stations the token must pass through is 40/2 = 20.

Answers

Given that,

Token is 64 bytes long

The average number of stations that the token must pass = 20

We need to calculate the transmission delay for token

Using formula of transmission delay

[tex]Transmission\ delay=\dfrac{token\ size}{minimum\ size}[/tex]

Put the value into the formula

[tex]Transmission\ delay=\dfrac{64\ bytes}{10\ Mbps}[/tex]

[tex]Transmission\ delay=\dfrac{64\times8}{10\times10^6}[/tex]

[tex]Transmission\ delay=0.0000512\ sec[/tex]

[tex]Transmission\ delay=5.12\times10^{-5}\ sec[/tex]

We need to calculate the average wait to receive token on an idle network with 40 stations

Using formula of average wait

[tex]\text{average wait to receive token}=\text{average number of stations that the token must pass}\times transmission\ delay[/tex]

Put the value into the formula

[tex]\text{average wait to receive token}=20\times5.12\times10^{-5}[/tex]

[tex]\text{average wait to receive token}= 0.001024\ sec[/tex]

[tex]\text{average wait to receive token}= 1.024\ ms[/tex]

Hence, The average wait to receive token on an idle network with 40 stations is 1.024 ms.

Recent advances in information technologies (IT) have powered the merger of online and offline retail channels into one single platform.

a. True
b. False

Answers

Answer:

True

Explanation:

With the recent advancement in IT we have witnessed offline retail businesses begin to get online presence. The advancement of the e-commerce sector and the convenience that it brings to customers through providing the ability to make orders online and get goods delivered to their doorsteps in a short time, has brought about escalating growth in the online and in extension offline retail businesses.

Big retail chains such as Walmart are taking advantage of this to increase their sales. Also, online retail presence helps put offline businesses out there in terms of advertising and marketing.

A ________ keeps your computer safe by determining who is trying to access it. gateway hub firewall switch

Answers

Answer:

firewall

Explanation:

a fire wall keeps unwanted hackers and viruses out of a computers system

Firewall keeps your computer safe

o maintain reasonable key security (mark all that apply): Ensure that someone else always has an extra key. Ensure that no extra duplicates are made. Maintain strict control over master keys and control keys. Ensure that the key cannot be linked to the lock it operates.

Answers

Answer:

The answer is "second, third, and fourth choices"

Explanation:

In the question the numbering of the choices were missing if we numbering the choices so, the first choice will be one first number and second choice is in second and so on, and its explanation can be defined as follows:

The network safety key is a type of network login credentials or passwords which is used for provides authorization as well as access the network or device upon which client requests to communicate throughout the form of physical, digital, or biometrical information login.  

It doesn't ensure the extra key.  It helps ensure there were no additional duplicates.  It keeps strict access codes as well as keys command.  It makes sure, that its key could not be linked to able to operate the lock.

In recent years, there has been an effort by companies to make computer chips:
O smaller.
O larger.
O bendable.
O harder

Answers

Answer:

A

Explanation:

Answer:

A) smaller

Explanation:

The purpose of an interface is to:___________
a) provide similar objects with the same functionality, even though each will imple­ment the functionality differently
b) provide different types of objects with the comparable functionality, even though each will imple­ment the functionality differently
c) provide default implementations of methods and properties
d) None of the above.

Answers

Answer:

Purpose of the interface

Provides communication − One of the uses of the interface is to provide communication. Through interface you can specify how you want the methods and fields of a particular type.Jul

Dani wants to create a web page to document her travel adventures. Which coding language should she use? HTML Java Python Text

Answers

Answer:

I would recommend Python Programming language

Explanation:

The major reason i recommend python is that It has a ton of resources, and community support, such that it is practically impossible to get stuck while carrying out a project

Python is easy,and lets you build more functions with fewer lines of code.

More so, provides a stepping stone to learning other code and it is a very  flexible language

A termination condition in a loop is analogous to________in a recursive method.
a) call.
b) iteration.
c) initialization condition.

Answers

Answer:

b) iteration.

Explanation:

There are various algorithms which are used in computer programming. Iteration is also a type of algorithm which is used to create loops. The instructions are inserted once and then these instructions are repeated to create a loop function.

Other Questions
In a nutrient medium that lacks histidine, a thin layer of agar containing around 10^9 Salmonella typhimurium histidine auxotroph produces around 13 colonies over a two day incubation period at 37 degrees centigrade. How do these colonies arise in the absence of histidine? The experiment is repeated in the presence of 0.4 micrograms of 2-aminoanthracene. The number of colonies the number of colonies produced over 2 days exceeds 10,000. What does this indicate about 2- anthracene? what can you surmise about its carcinogenicity? "A customer wishes to open an account at a FINRA member firm, but wishes his identity to remain hidden to the employees at the branch office. Which statement is TRUE?" Frank needs to fill juicecups for his little sister's birthday party there are 35 juice cups in each juice cup holds 12 fluid ounces the juice comes in a 1 gallon bottle how many 1 gallon bottles of juice will Frank need to purchase Simplify the expression to a polynomial in standard form: (x3)(x 2 7x2) The assumption that the cash flows from an investment project are reinvested at the company's discount rate applies to: (6,-1) and y = 1/3x+ 1y = 3x + [?] habits i want to work on this school year is? Find the equation of the line with slope 3 and that contains the point (-2,-6). Write the equation in the form y = mx +b andidentify m and b. Of the variables in the Black-Scholes OPM, the __________ is not directly observable. Group of answer choices variance of the underlying asset return risk-free rate of interest price of the underlying asset time to expiration Rumors, superstitions, or propaganda can replace reason with irrational hysteriawhen groups of people get together.Agree, Disagree, or Unsure which of the following statements would confucius most likely agree with? A. i am a failure because i never found the ideal ruler willing to govern from my teachings B. I am the way, the truth, and the life. Your life will be better off by following my teachings. C. it is important to follow the 5 relationships of friends. D. I think the golden rule is the most important rule in life. graph: y-3= 1/2(x+2) hunger games the book question.Explain how the society in the novel is similar to the society of North Korea A particle is moving along a projectile path at an initial height of 160 feet with an initial speed of 144 feet per second. This can be represented by the function H(t) = 16t2 + 144t + 160. What is the maximum height of the particle? There are four activities on the critical path, and they have standard deviations of 1, 2, 4, and 2 days. The standard deviation of the critical path is Consider the solid obtained by rotating the region bounded by the given curves about the y-axis. y = ln x, y = 3, y = 5. x = 0 Find the volume V of this solid. V = ____ Sketch the region, the solid, and a typical disk or washer. (Do this on paper. Your instructor may ask you to turn in this work.) How does the area of the rectangle relate to the lengths of each side? The player who won silver medal in London Olympics in 2012?1)Yogeshwar Datt2)Sushil kumar3)Geetika Jhakhar4)Ravinder Singh Use the punnett squares below to model each parent combination after filling in each Punnett square predict then percentages of black and white offspring In what way was America a New World for Europeans?( will mark brainliest to best response )