Design an algorithm that will prompt for filename

Assignment Help Computer Engineering
Reference no: EM132208421

Write the program in c++ only

A file of student records contains name, gender (M or F), age (in years), and marital status(S or M) for each student. Design an algorithm that will prompt for filename, make sure the input file exists. then read the file and generate a report.

The first part of the output report are the Eligible Bachelors.

If any single men are over 30 years of age, print their names and ages. Also, while you are reading the file, calculate the numbers of married men, single men, married women, and single women (this will require multiple counters...). Print the totals in the Student Summary section.

Make nice headings and format for your output file (see example below). No other output is generated in the runtime console window. (Although while you are testing, you may want to send output there to make sure you are reading the file correctly).

Format of output file

Eligible Bachelors

Name Age

Slkdfj slkd 31

Slkd fslkdf 35

Student Summary Report

Married men: xx

Married women: xx

Single men: xx

Single women: xx

Total students xx

Create the file students.txt listed below for testing. Print the output file as your runtime output. I will test your program on another file that I create.

So you might want to create another file to try out! Remember to use Notepad, and remember to hit "Enter" at the end of the last line, otherwise you may not read out the last line correctly.

Example of input file format: (Notice that the # character is used to indicate the end of the name, you will have to use getline with ‘#' as the delimiter character.)

Name#gender age maritalstatus

Jenny Smith#F 25 M

John Brown#M 32 S

Tom Jones#M 22 S

Ann Jones#F 35 M

Sue Davis#F 20 S

Bugs Bunny#M 45 S

Captain Kirk#M 50 S

Lucy Ricardo#F 39 M

Reference no: EM132208421

Questions Cloud

Identify the cultural movements of the contemporary age : You will write a paper on the theme of how cultural movements in the contemporary age have impacted the development of Western culture.
Dynamically allocate student objects and store the objects : Dynamically allocate student objects and store the objects in the array humanList (an array of human pointers).
Program to show inflation rates for two successive years : Write a program in C++ that outputs inflation rates for two successive years and whether the inflation s increasing or decreasing.
How many hours should you quote for the first five units : You are bidding a project for the JSF and your team has estimated that at unit 50 you should be able to make a particular part for 55 hours.
Design an algorithm that will prompt for filename : A file of student records contains name, gender (M or F), age (in years), and marital status(S or M) for each student.
Would share a heavier tax burden : Suppose the government imposes a per-unit tax on the cigarette sellers. Who, buyers or sellers, would share a heavier tax burden? Explain your answers without.
What is the cost inflicted on the neighbour : People live right beside the OSP factories constantly complain about the horrible noise generated in the process of training parrots to sing La Traviata.
Write a program in c that builds a contiguous list of 1 : Write a program in C that: a. Builds a contiguous list of 100 cells. b. Populates the cells with random numbers between 0 and 1000.
Why do governments usually apply a sales tax to the goods : Why do governments usually apply a sales tax to the goods that are characterized by an inelastic demand rather than elastic demand?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Examine the practicality of building multiple interface

Examine the practicality of building multiple interface options for diverse populations, rather than building one interface that meets the needs of the majority of end users.

  Describe an algorithm that computes the product xy

Describe an algorithm that computes the product XY using Strassen's algorithm as a subroutine, i.e., use it as a black-box without modifying it.

  Write the python statement that will print the number

Write the Python statement that will print the number of arguments that were provided on the command line.

  What is the best data structure to store the students

What is the best data structure to store the students in a soccer team? Justify your answer.

  Show the masks in longest mask order using cidr format

A packet is waiting at router R4 for forwarding. If the next-hop was a "direct delivery", which of these three networks is the destination network?

  Write down a c function that adds the values

Write a C function that adds the values of all elements in a two-dimensional array that is passed to the function, suppose that the array is an array of double-precision numbers having 4 rows and 5 columns.

  Write a java program that read strings until done is entered

Write a java program that reads strings until "done" is entered that will count the number of times a specified character is contained in the string.

  Write a driver program that reads strings from a file

Design and implement a class named StringTree, a binary tree for storing String objects in alphabetic order.

  Boundary node routers and interior node routers

Explain how are the boundary node routers are different from the interior node routers in the DS domain? The answer requires to be at least 300 words. Also involve any references.

  Get a string from the user at the command line

Populate an ArrayList of Character data (the wrapper class), with each char in the String represented as a separate Character element in the ArrayList.

  Discuss some of the physical security systems

This is a scholarly post and your responses should have more depth than "I agree" and should demonstrate critical reflection of the problem in order to promote.

  Describe what information is required to track check out

Describe what information is required to track check out and check in of books and how this information is stored in your data warehouse

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