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++

Write a c program that prompts the user to enter a line of

Write a C program that prompts the user to enter a line of text (up to 50 characters). It should then convert the text entered to uppercase letters and then to lowercase letters, and then to Sentence case. Your program s ...

Write a c program that requests the name of any cartoon

Write a C program that requests the name of any cartoon character from the user, then does the following with that name (use printf for each): a. Displays it enclosed in double quotes. b. Displays it in a field 24 charac ...

Assignment a random mazewrite a new c program with the

Assignment (a) Random Maze Write a new C++ program with the following functionality: The program writes a greeting on the screen. Then the program displays a maze of ASCII symbols on the screen. The maze consists of 8 ro ...

Computer applications divisionassignment c programmingstl

COMPUTER APPLICATIONS DIVISION Assignment: C++ PROGRAMMING STL Vector For this assignment, you will be starting with an example program that demonstrates the use of a STL vector. In addition to this, you may need to look ...

Projectdecision statementsdirections read carefully and

Project: Decision Statements Directions (Read CAREFULLY and follow COMPLETELY): - Create the following programs in C++ that perform the purpose described and show the sample output (with user input where applicable). - I ...

C projectphase 11- you need to take input from user study

C project Phase 1 1- You need to take input from user study year (proper value check from 1 to 4) 2- Take input semester (proper value check 1 to 8) 3- Calculate GPA (use Loop, calculate GPA for semester 1,2,3...) Exampl ...

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 ...

1 write a c program that includes a function called lobster

(1) Write a C program that includes a function called lobster() that accepts three arguments: a character and two integers. The character argument is the character to be printed by lobster(). The second argument is the n ...

Assignmentbullwrite the code for each lab

Assignment • Write the code for each lab assignment. • Submit the lab in a single zip file in the online course shell. The lab must contain all .cpp files, along with any additional files that may be necessary for your p ...

Assessment taskthis coursework will allow you to

Assessment Task: This coursework will allow you to investigate some of the issues involved in writing threaded programs. You are to write a series of simple programs in C/C++ that will run under Linux, to illustrate how ...

  • 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