Analyze the data in the form of a summary

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

CheeseCake

This assignment is quite simple but could turn out to be one of the more complicated programming projects that you will have this term. This assignment will involve storing information in a dynamically allocated array, sorting information and then looking at the data and analyzing the data in the form of a summary. You are to read in a file that contain several records of data, each record will contain: The Last Name of the person taking the survey, First Name of the person taking the survey, and a character "C" or Character "P" that indicates whether a person believes that Cheese cake is a cake "C" or is really a pie "P" . There are an unknown number of records. Programming Specifications: Here are the lists of tasks and specifications.

1. Ask the user for the name of the input file. You must make sure it is a valid file and that it can be opened. If not, you need to continually ask the user for a valid file.

2. Open the file and read the contents only counting the number of records in the file.

3. Close file.

4. Dynamically allocate an array to store the data make sure that you only allocate enough storage to hold exactly the number of records needed.

5. Open the file and read the file into the array.

6. Sort the Array on Last Name in ascending order.

7. Print out the information (to standard output) using the example at the end of this document.

8. Print out at the end of the summary of information (i.e. how many people said that Cheesecake is a Cake and how many said it was a Pie).

9. Also print out the number of participants.

Be sure that the number of people who said Cheesecake is a Cake + Cheesecake is Pie is equal to the total number participants. COP3010 Programming I in C/C++ COP3014 Page 2 Design

Considerations:

1. You will use this C/C++ struct to define your data structure. struct Roster { string LName; string FName; char Cheesecake; } struct Roster * MyRoster;

2. You must determine how many records are in the file before you allocate the array to hold the data.

3. You must have the minimum functions to perform the following operations: o Get a valid file name that holds the data o Read the data into the array passing the array as a parameter o Sort the data o Find the number of people who said Cheesecake is a Pie passing the array as a parameter and returning the number as a return value of the function. o Find the number of people who said Cheesecake is a Cake passing the array as a parameter and returning the number as a return value of the function. o Sorting the Array passing the array as a parameter by reference. o Printing the report passing the array as a const value.

General Requirements:

1. No global variables, other than constants and type definitions!
2. Use the const qualifier on member functions wherever it is appropriate.
3. Your main routine should just mainly handle the calling of functions and basic program structure.
4. You will need to use the library for output. You may use the library for formatting your output if you wish.
5. When you write source code, it should be readable and well-documented.
6. You must have prototypes for all of your functions.
7. You may use any sorting technique you wish but the simplest (exchange or bubble sort) is all that is required.
8. The size of the array must match exactly the number of records in the file. No more no less.

Attachment:- CheeseCake.txt

Reference no: EM131028394

Questions Cloud

Verilog description for the multiplexer : Write a Verilog description for the multiplexer in the above figure by using a process containing a case statement rather than the continuous assignment statements.
Discuss how the mcqm system connects all processes : Start the paper with a brief overview and description of FDA and ISO regulations that exist to protect consumers. Briefly discuss how the MCQM system connects all processes critical to compliance.
In how many ways can he choose 3 good hitters : The coach of the Morton Valley Softball Team has 6 good hitters and 8 poor hitters. He chooses 3 hitters at random.
Jawbreaker vending machine : Write a VHDL description for the state-machine diagram for the jawbreaker vending machine described in Problem. You may obtain the state machine diagram by either solving Problem or ?nding its solution on the textbook website.
Analyze the data in the form of a summary : This assignment will involve storing information in a dynamically allocated array, sorting information and then looking at the data and analyzing the data in the form of a summary.
Is there enough information to determine the value of n : If the number of permutations of n objects taken r at a time is six times the number of combinations of n objects taken r at a time, determine the value of r. Is there enough information to determine the value of n? Why or why not?
Vhdl description for the multiplexer : Write a VHDL description for the multiplexer in below figure by using a process containing a case statement rather than the continuous assignment statements.
Do you think that x is a metal or nonmetal : An element X reacts with F2(g) to form the molecular product shown here. Write a balanced equation for this reaction (do not worry about the phases for X and the product).
State-machine diagram for the soda vending : a) Find the state-machine diagram for the soda vending machine as speci?ed. b) The speci?cation as given is not very user friendly. Rewrite it to provide a remedy for every possible situation that the user might encounter in using the machine.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  The goal of this project is to create

The goal of this project is to create a simple command line program that reads in a single word from the command line (use the "int argc, char * argv[]" approach discussed in class and in previous projects) and stores the unique letters of that wo..

  Display a list of items and the location in the store

The program should display a list of items and the location in the store. The user must be able to enter the items and location in the store. You will use a class for the items. For this assignment you will implement creating the list, adding eleme..

  Program that print out the contents of the file

Write a program that will prompt for a file name to open for writing. Prompt the user for 5 lines of text, writing each to the file. When finished, print out the contents of the file.

  A sample of helium gas occupies 945ml at 605 mmhg

A sample of helium gas occupies 945mL at 605 mmHg. For a gas sample at a constant temperature, determine the volume of helium at 745 mmHg?

  Refresher on andys basic requirements

The game Battleship is back and better than ever. Instead of hacking everything together in C, you will instead leverage C++ and all of your newly gained object oriented programming knowledge to construct a much cleaner end product.

  Convert infix to postfix and also calculate the result

I have to convert infix to postfix and also calculate the result. We have been given test data via a text file.

  Function that accepts a score for a driver''s license

Write a function that accepts a score for a driver's license facility, an int or a float, and returns a letter. If the score passed in is less than 75, then the letter returned is an F for Fail. Otherwise, the letter returned is a P for Pass.

  Create a sodoku validator

There is a problem in my operating systems class where my partner and I have to create a sodoku validator using C++. It must also be multithreaded.

  Write a program that reads an infix or postfix expression

Write a program that reads an infix or postfix expression from an input file, evaluates the expression and outputs the result.

  Program for how to indicate the family member entry

Program for how to indicate the family member entry is complete

  Define a static method samecolor in the car class

Write an abstract class Car to implement the Comparable interface. Write a Truck class and a Sedan class to implement Car. define a static method sameColor in the Car class to find out weather a Truck and a Sedan has the same color.

  The keyboard and display on the screen

Use the readLn and writeStr functions to read from the keyboard and display on the screen. Your function to convert from a decimal text string to an int should be placed in a separate function. this problem cannot be solved by simply shifting bit pat..

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