Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

problem 1) For research purposes and to better help students, the admissions office of your local university wants to know how well female and male students perform in certain courses. You receive a file which contains female and male student GPAs for certain courses. Due to confidentiality, letter code f is used for female students and m for male students. Every file entry consists of the letter code followed by the GPA. Each line has one entry. The number of entries in the file is unknown. prepare a program whihc computes and outputs the average GPA for both female and male students. Format your results to two decimal places. Your program must use the following functions:

a) Function openFiles: This function opens input and output files, and sets output of the floating-point numbers to two decimal places in the fixed decimal format with the decimal point and trailing zeros.

b) Function initialize: This function initializes variables like countFemale, countMale, sumFemaleGPA, and sumMaleGPA.

c) Function sumGrades: This function finds sum of female and male students’ GPAs.

d) Function averageGrade: This function determines average GPA for female and male students.

e) Function printResults: This function outputs the appropriate results.

f) There could be no global variables. Use the suitable parameters to pass information in and out of functions.

problem 2) prepare a program to convert time from 24-hour notation to 12-hour notation and vice versa. Your program should be menu driven, giving the user the choice of converting the time between the two notations. In addition, your program should contain at least the following function: a function to convert time from 24-hour notation to 12-hour notation, a function to convert time from 12-hour notation to 24-hour notation, a function to display the choices, function(s) to get the input, and function(s) to display the results. (For 12-hour time notation, your program should display AM or PM.)

problem 3) The cost to become the member of a fitness centre is as follows: (a) the senior citizens discount is 30%; (b) if the membership is bought and paid for 12 or more months, the discount is 15%; and (c) if more than five personal training sessions are bought and paid for, the discount on each session is 20%.

prepare a menu-driven program which determines cost of the new membership.

Your program should contain a function which displays general information about the fitness centre and its charges, function to get all of the essential information to find out the membership cost, and function to determine membership cost. Use suitable parameters to pass information in and out of a function. (Don’t use any global variables.)

problem 4) prepare a C++ function, smallestIndex, which takes as parameters an int array and its size and returns index of the first occurrence of the smallest element in the array. Also, prepare the program to test your function.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M94524
  • Price:- $40

Guranteed 36 Hours Delivery, In Price:- $40

Have any Question? 

Related Questions in C/C++

Assignmentconsider the following declarationsclass

Assignment Consider the following declarations: class bagType { public: void set(string, double, double, double, double); void print() const; string getStyle() const; double getPrice() const; void get(double, double, dou ...

Cosci 21a programming assignmentpurpose experience with

COSCI 21a, Programming Assignment Purpose: Experience with some basic data structures, including circular queues, linked lists, hash tables, and specifically with pointers and the associated dynamic memory allocation. Pr ...

Assignmentinstructionsthis assignment is to implement your

Assignment Instructions This assignment is to implement your own mini-grocery store in C++. Suppose you have the following Food hierarchy: FOOD FRUIT APPLE BANANA GRAPE DAIRY MILK YOGURT CHEESE (your choice) (three items ...

Write a program to draw a symmetric shape of your own using

Write a program to draw a symmetric shape of your own using C++ user-defined functions and arrays. The program should draw a shape in its original and opposite forms (black and white and then white and black). Please con ...

Create your own unique while-end repetition structure you

Create your own unique While-End repetition structure. You decide the theme. You should provide both the pseudocode and the flowchart of your example. Be sure to provide an overview of what your repetition structure is d ...

Assignmentthis is the programthis program will use 2

Assignment This is the program: This program will use 2 different data structures to perform the same tasks; a vector and a dynamically sized array Write a complete C++ program that will: Declare a vector of integers wit ...

Write a c program that calculates and prints the average of

Write a C program that calculates and prints the average of two or more salaries entered by the user. The program should first prompt the user to enter the number of salaries to process (make sure: at least 2 salaries mu ...

Discussionkeyboard versus file input please respond to the

Discussion "Keyboard versus File Input" Please respond to the following: • Suppose you are designing a C++ application that needs to capture user input specifically via a keyboard or from a file. Determine the method tha ...

A compiler that translates a high-level language into

A compiler that translates a high-level language into another high-level language is called a source-to-source translator. What advantages are there to using C as a target language for a compiler?

Assignmentwhen writing c programs include comments in your

Assignment When writing C++ programs include comments in your code, make the program readable by indenting, use meaningful variable and function names, and produce meaningful output. This assignment will be to write a bm ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen