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
neonofarm [45]
3 years ago
8

During a drawing competition, the review system is implemented by assigning 3 to 5 reviewers per submission. Each drawing is ran

ked by 3 to 5 reviewers on a continuous scale of 1 to 5 (1 being the lowest score and 5 being the highest, decimal numbers are not allowed).
Final results are saved in the reviews file (given separately). (Format of each line: author_name,score_1score_2............score_5)
James, 24152
Ann, 145
Thomas 5345
Mark,432
Karen, 222
Write a C program to read, process, and output data as explained:
1. Read and process the content of the reviews text file.
2. Calculate the average score per contestant. (average = sum of all the scores / number of scores)
3. Display results in a formatted chart. For each contestant, list the name and the 3 to 5 scores followed by the average score.
Comments are not required, define functions where necessary.
Name S1 S2 S3 S4 S5 Ave
James 2 4 1 5 2 2.8
Ann 1 4 5 3.33
Thomas 5 3 4 5 4.25
Mark 4 3 2 3
Karen 2 2 2 2
James, 24152
Ann, 145
Thomas, 5345
Mark, 432
Karen, 222
Computers and Technology
1 answer:
lisabon 2012 [21]3 years ago
4 0

Answer:

See explaination

Explanation:

//include <stdio.h>

#include <stdlib.h> // For exit()

#include <stdbool.h>

int main()

{

FILE *fptr;

char filename[100], c;

// Open file

fptr = fopen("review.txt", "r");

if (fptr == NULL)

{

printf("Cannot open file \n");

exit(0);

}

// Read contents from file

c = fgetc(fptr);

printf("Name S1 S2 S3 S4 S5 Ave\n");

bool flag = false;

int sum = 0;

int count = 0;

while (c != EOF)

{

if(c == '\n'){

printf ("%f ", (double)sum/count);

count = 0;

sum = 0;

flag = false;

}

if(c != ',')

{

if(flag){

printf ("%c ", c);

sum = sum + (int)(c)-48;

count++;

}

else

printf("%c", c);

}

if(c == ',')

{

flag = true;

printf(" ");

}

c = fgetc(fptr);

}

printf ("%d ", sum/count);

fclose(fptr);

return 0;

}

You might be interested in
You are troubleshooting network connectivity issues on a workstation. Which command would you use to request new IP configuratio
kolezko [41]

Answer:

ipconfig / release command will be used to request new IP configuration information from a DHCP server

Explanation:

The ipconfig /release sends a DHCP release notification to the client so that the client immediately releases the lease henceforth updating the server's status information . This command also mark the old client's id as being available. Thus, the command ipconfig /renew then request a new IP address.

4 0
3 years ago
Ehred is a network technician for a hotel chain and has been notified that one of the locations is having issues with the guests
Ray Of Light [21]

Option a is correct. Captive portal issues is might best describe the issue occuring in this hotel.

Before newly connected users of a Wi-Fi or wired network are given full access to network resources, they are first shown a captive portal, which is a web page that can be accessed via a web browser. Authentication, payment, acceptance of an end-user license agreement, adherence to an acceptable usage policy, completing a survey, or other valid credentials that the host and user agree to abide by may be required when presenting a landing or log-in page through a captive portal.

Cable, commercially available Wi-Fi, and home hotspots are just a few of the mobile and pedestrian broadband providers that utilise captive portals. Access to residential or corporate wired networks, such as those in apartment buildings, hotel rooms, and business centers, can also be provided by a captive gateway.

To know more about captive portal click here:

brainly.com/question/14280680

#SPJ4

5 0
1 year ago
Read 2 more answers
Question 4 A data analyst wants to include a line of code directly in their .rmd file in order to explain their process more cle
hichkok12 [17]

A line of code that can be inserted directly into a .rmd file is called an inline code.

R Markdown (.rmd file) is a file format that is typically used for making dynamic documents by using R Studio and R programming language. Also, R Markdown files can be used in the following ways:

  • To save, organize, and document an executable code.
  • To create a record of any cleaning process.
  • To generate reports containing an executable code for stakeholders.

In R Studio, an inline code is a line of code that can be inserted directly into a R Markdown (.rmd file), in order to explain a process more clearly.

Read more on R Markdown here: brainly.com/question/25558534

8 0
3 years ago
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Hoochie [10]

Answer:

I suggest a core !3

Explanation:

Its pretty good for beginners

3 0
3 years ago
Malware or malicious software does not include which of the following? A. Spyware B. Trojan Horses C. Computer viruses D. New so
Fed [463]
I would say answer choice D
6 0
3 years ago
Read 2 more answers
Other questions:
  • What command do you type in the search box to access the command line intrface in windows?
    8·1 answer
  • What are personal skills?
    5·1 answer
  • Add an array, which will store the most recent 5 recent transactions. For the array, add an insert function which will store the
    10·1 answer
  • Which of the following statements correctly instantiate the Rectangle object myRectangle? (i) myRectangle Rectangle = new Rectan
    6·2 answers
  • Which method of traversing a tree would result in a sorted list for a binary search tree?
    11·1 answer
  • Which stage of the waterfall model is most like the simple model's stage 5?
    12·1 answer
  • When reading words using a Scanner object's next method, _________. a. any characters at the beginning of the input that are con
    5·1 answer
  • One of the difficult things about working in game design is that while there are many different roles, most of them only match o
    15·1 answer
  • Add definitions for the following keywords to your glossary of words.
    6·1 answer
  • how does the use of data abstraction manage complexity in program code? how does using lists make a program easier to develop an
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!