Explain in detail programming constructs

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

In a party, among a group of gift-giving friends, each person sets aside some money for gift-giving and divides this money evenly among all those who came to the party (including self). However, like in any group of friends, some people are more giving than others and some people have more money than others. You are to write a program that determines how much more (or less) each person in the group gives than they receive.

Specific Directions:

You are to write the program so that it would read the input from a file and the output should go to screen as well as to a file. The input file contains more than one group. You should have a loop to read the several groups and show the result after the calculation. Use manipulators to format the output. After reading each group's data the sentinel value should be checked to see if the program should process or terminate.

The input is a sequence of gift-giving groups. Each group specifies the number of people in the group, a list of the names of each person and the money they gave in the group. Each group has five persons and hence you could use five strings to store their names, five doubles to store their contribution and so on. The output should specify the name of each person in the group, what they gave, what they received and how much more (or less) money they gave than they received. For each group, the member who gave the most money should be displayed.

The program should be written as a two-module set. The main( ) function will have its own module, and the remaining functions will reside in the other module. The main( ) should do almost no processing, it should simply call functions to do whatever it needs, such as get_input( ), display_result( ), etc. It will basically be a while loop with a condition and a series of function calls in the body of the loop.
Hand in your documented source code and input/output files and sample screen output.

Required Programming Constructs:

• While Loop

• File Stream I/O

• If..else

• reference parameters and value parameters (as needed)

• void and non-void return function

Input valueJoey 200
Owen 500
Amir 150
Laura 0
Vick 0
-1
John 100
William 400
Josh 350
Kelly 20
Myra 45
-1
output values

---------------------------------------------------------------------
Name Gave Received Difference
------- ------- ----------- - ------------
Joey $200.00 $170.00 $ 30.00
Owen $500.00 $170.00 $330.00
Amir $150.00 $170.00 -$ 20.00
Laura $ 0.00 $170.00 -$170.00
Vick $ 0.00 $170.00 -$170.00
Person who gave most in the group: Owen

Group 2
---------------------------------------------------------------------
Name Gave Received Difference
------- ------- ----------- - ------------
John $100.00 $183.00 -$ 83.00
Josh $350.00 $183.00 $167.00
Kelly $ 20.00 $183.00 -$163.00
Myra $ 45.00 $183.00 -$138.00

Reference no: EM13937011

Questions Cloud

Integrated marketing communications plan report : Development of a comprehensive, detailed Integrated Marketing Communications plan report and presentation - 1400 - 1500 words.
Network according to a business specification : Networks are fundamental to every aspect of our society. Designing a network that is both adequate to current and future needs is important. In this assignment, you are asked to design a network according to a business specification. Business Str..
Is evolution a proven fact or a theory : Is "evolution" a proven fact or a theory? What other ideas compete with evolution to explain changes in populations? What are the differences between these competing ideas?
What type of nic is installed in your comptuter : What type of NIC is installed in your comptuter - an expansion card, a wireless card or an embedded NIC?  Use the status of your Local Area Connection object to determine the speed of your network adapter
Explain in detail programming constructs : In a party, among a group of gift-giving friends, each person sets aside some money for gift-giving and divides this money evenly among all those who came to the party (including self). However, like in any group of friends, some people are more g..
Is this an example of gradualism or punctuated equilibrium : At one time the continent of Australia was connected to Asia. About 50 million years ago Australia became separated. It has many unusal animal not found elsewhere, such as the kangaroo and the koala bear. Using the concepts of geographic isolation..
Information on the target audience segment analysis : 1. Brief background, of company its products/services and its marketing objectives. 2. Information on the target audience segment analysis. ( 4 segments)
Describe some of the benefits of improving quality : Describe some of the benefits of improving quality. How does conformance quality differ from quality of design? Explain. Name two items classified as prevention costs.
Are the two reasons you have given mutually exclusive : As you examine different populations of this species, you find that the R allele predominates in some populations and r allele predominated in others. Give two possible reasons for these difference.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program that will be used to gather statistical data

Write a program that will be used to gather statistical data about the number of movies

  Write a test program that creates an account object

Write a test program that creates an Account object with an ID of 1122, a balance of 20000USD, and an annual interest rate of 4.5% - Use the withdraw method to withdraw 2.500USD, use the deposit method to deposit 3000USD and print the balance, mont..

  Five elements similar to having different variables

How is an array with five elements similar to having five different variables?

  Derive the expression for variance of the continuous uniform

Derive the expression for variance of the continuous uniform probability distribution (we derived the expression for mean in class). Show your work.

  C++ pointer function synopsis

C++ pointer Function Synopsis: char *amonthLess(char *dateString) Description: Variable dataString is a valid date in a form of mm/dd/yyyy Given the above information, write a main() program that asks a user to enter a date in a form of mm/dd/yyyy..

  Write a program that asks the user to enter two numbers.

Starting Out with C++ Write a program that asks the user to enter two numbers.

  Write a c++ code for how to learn oop

Write a C++ code for How to learn OOP (Object oriented programming) by CPP(C Plus Plus) - general-purpose programming language

  Design a class box that defines a box on a floor

Design a class box that defines a box on a floor. A box has a number and an (a,b) location where a and b are numbers between -5, and 5.

  Program calculates and displays salesperson''s commission

The sales manager at Tompkins Company wants a program that calculates and displays each salesperson's commission, which is 10% of his or her sales. It also should display the total commission. Use a value-returning function to get the amount sold by ..

  Write a program for a college admissions office

Write a program for a college admissions office. The user enters a numeric high school grade point average (Ex 3.2), and an admission test score. Print the message "Accept" if the student meets either of the subsequent requirements:

  Create a program that maintains the required book catalog

create a program that maintains the required book catalog for the circulation desk of a library. the book catalog is to

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