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

  Individual genes are substrings of a genome

Individual genes are substrings of a genome delineated by 3-element start and stop codons. Genes begin with the start codon ATG and end with one of the following 3 stop codons: TAG, TAA or TGA. Note that start codons can appear anywhere in the string..

  Design a class named employeerecord

Design a class named EmployeeRecord that holds an employee's ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that

  Write a program to print the permutation

Write a program to print the permutation that lexicographically precedes the given input permutation.

  Overall use-case diagram considering the scnarios

1. Draw the overall use-case diagram considering the scnarios 2. Draw the Use case brief description - with ore and post conditions

  Modify the code to change the variables

Quickly modify the code to change the variables if needed to the correct data type. Comment the code and indicate what the line or function performs

  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 program that simulates the dial of a phone number

Write a program that simulates the dial of a phone number. The program will accept a phone number as input, and it will acknowledge the call by either writing an error message or the 8 digit phone number to the console window. The phone number may..

  Collection of course components and weighting schemes

Define the data type that represents the collection of course components and weighting schemes and break down the required functionality into modular, reusable functions

  File system with login authentication

Implement a simple file system with login authentication and access control - Construct a hash/salt/shadow based user/password creation system.

  Implement the default constructor

Implement the default constructor and the constructors with one and two int parameters. The one parameter constructor should initialize the first member of the pair; the second member of the pair is to be 0.

  Create the roman.h and implement roman class in roman.cpp

Create the roman.h and implement the Roman class in roman.cpp. Make sure that you put in measures to prevent multiple inclusion of the header file. Test your implementation using task2a.cpp.

  Manipulate various types of accounts

Each of these accounts has various options. For example, you may have a savings account that requires no minimum balance but has a lower interest rate. Similarly, you may have a checking account that limits the number of checks you may write. Anot..

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