Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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: 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. BIRD.txt MACAW 2,500.00 20 AMAZON 550.75 15 COCKATIEL 123.50 2 PARAKEET 45.50 1 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. 3. Your program will also calculate the average price of a bird and the average amount of food eaten in one month. 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. PRICE FOOD HOOKBILL BIRD 20 MACAW 2500.00 AMAZON 550.75 COCKATIEL 123.50 PARAKEET 45.50 The average price is: 804.94 The average food is: 9.50 Lab 2 (loop and selection) Problem 1. (Displaying pyramid) Write a program that prompts the user to enter an integer from 1 to 9 and display a pyramid, as shown in the following sample output: Enter the number of lines: 5 212 321 23 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5 Problem 2 (Displaying calendar) Write a program that prompts the user to enter the year and first day of the year and displays on the console the calendar table for the year. For example, if the user entered the year 2005, and 6 for Saturday, January 1, 2005, your program should display the calendar for each month in the year, as follows

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions