Write a c program that defines a data type

Assignment Help C/C++ Programming
Reference no: EM132194772

Question: Write a C program that defines a data type (structure ) called course which includes the following fields on Computer Science courses:

Course name (string) e.g. comp230

(All course names start with the word "comp" followed by a three digit number for the course's number). The first of those numbers indicates the year level of the course (e.g. comp230 is for second year level students, while comp132 is for first year level students, and comp438 is for fourth year level students).

Number of students in course (integer)

Course's average grade (double)

Your program should read the information for up to a maximum of 20 courses from a file called course_info.txt and store it in an array of structures called courses.

Your program should then print the average grade for all first year courses, second year courses, third year courses, and fourth year courses as well as the highest of those averages.

Example:

Assume the file course_info.txt contains the following data:

comp132 50 71.30

comp230 73 68.72

comp142 72 75.6

comp232 90 62.73

comp432 30 70.23

Then your program should print the following result:

First year courses avg = 73.84

Second year courses avg = 65.41

Third year courses avg = No courses

Fourth year courses avg = 70.23

The highest average = 73.84

Note: Notice that the average calculations take into consideration the number of students in each course for example:

To calculate first year student average the program does the following:

(71.3 * 50 + 75.6 * 72) / ( 50 + 72) = 73.84

You need to turn in the following items:

A hard copy of your C program with your name, id, and section # typed on it as well as a hard copy of the content of file course_info.txt.

A hard copy of one complete successful run of your program (similar to that shown above)

Reference no: EM132194772

Questions Cloud

Write a c program that contains a structure : Write a C program that contains a structure that uses predefined types and union. Create a struct with name, age, kind (Either child, college student, or adult)
A c program that will check the current setting of echo : Write a C program that will check the current setting of "echo". It it is on, display the message and turn it off.
Write a program to create two files : Write a C++ program to create two files named abc.txt which contains the text I love C++ Programming and def.txt which contains the text.
A program for the frequency histogram : Write a C++ program (c++14). ask the user give some inputs. and then output the frequency histogram of them.
Write a c program that defines a data type : Write a C program that defines a data type (structure ) called course which includes the following fields on Computer Science courses.
Calculate the product of the two integers : The function takes two integers as arguments and calculates the product of the two integers. The function will return the product.
The user for a positive number n representing the number : Write a C program called sort.c that first prompts the user for a positive number n representing the number of numbers to be sorted.
Ask the user to enter a time in the format : Write a c++ program that asks the user to enter a time in the format HH:MM, if all digits are the same print , "you lucky".
Mean an improvement in economic welfare : Explain why a high economic growth rate does not necessarily mean an improvement in economic welfare

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd