Cheap Chirps Is a Pet Store Specializing in Pet Birds

Cheap Chirps Is a Pet Store Specializing in Pet Birds

<p> Lab 1 Problem 1. Use a nested loop to print out the following: ******** ******* ****** ***** **** *** ** * Problem 2. Comprehensive programming: (file I/O, if…else, for loop, output manipulators) Cheap Chirps is a pet store specializing in pet birds. The store needs a new inventory program and has hired you to develop the program. Write a C++ program that will:</p><p>1. Read an inventory list of birds from a data file called BIRD.txt. The file contains information on bird species in the store. There are four lines in the file. Each line of the file has type of bird (no larger than 20 characters), price of the bird, and the consumed food in pounds monthly. Use for loop to read the related information.</p><p>BIRD.txt MACAW 2,500.00 20 AMAZON 550.7515 COCKATIEL 123.50 2 PARAKEET 45.50 1</p><p>2. Your program will find if the bird is a large hookbill or a small hookbill (Large hookbills eat 15 or more pounds of food a month.) Use a character 'L' to represent a large hookbill and an 'S' to represent a small hookbill. </p><p>3. Your program will also calculate the average price of a bird and the average amount of food eaten in one month. </p><p>4. Print the output so that it is organized as below. Note the values for the averages are printed to two decimal places. All printing is done in the main function. </p><p>BIRD PRICE FOOD HOOKBILL ------MACAW 2500.00 20 L AMAZON 550.75 15 L COCKATIEL 123.50 2 S PARAKEET 45.50 1 S The average price is: 804.94 The average food is: 9.50</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us