You are tasked with helping a friend with managing a pet store inventory and sales. Create a program written in C to enter and store an initial number of cats and dogs in addition to the cost price of each. The output of the program should include the number of cats, price per cat, and price for all cats, and the same goes for dogs. Finally, the output should include the total cost of all pets (cats and dogs) in the store. The following instructions should be helpful: - Create an integer variable named cat - Create an integer variable named dog. - Create a float variable named catp. - Create a float variable named dogp. - Create a float variable named ctotal, dtotal, ptotal. - Prompt the user to enter the number of cats and store it in the variable cat. - Prompt the user to enter the number of dogs and store it in the variable dog. - Prompt the user to enter the price per cat and store it in the variable catp. - Prompt the user to enter the price per dog and store it in the variable dogp.               - Calculate the price for all the cats in the store and store it in ctotal. - Calculate the price for all the dogs in the store and store it in dtotal. - Calculate the total cost of all the pets in the store and store it in ptotal. - Output the store information as in the screen shot below. - The output should be formatted neatly as shown in the example below, make sure to test with smaller and then larger number to ensure that the alignment is proper (5 or 5000 or each pet, price of 2.5 or 50000 per pet).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

You are tasked with helping a friend with managing a pet store
inventory and sales. Create a program written in C to enter and store an
initial number of cats and dogs in addition to the cost price of
each. The output of the program should include the number of
cats, price per cat, and price for all cats, and the same goes for
dogs. Finally, the output should include the total cost of all pets
(cats and dogs) in the store. The following instructions should
be helpful:
- Create an integer variable named cat
- Create an integer variable named dog.
- Create a float variable named catp.
- Create a float variable named dogp.
- Create a float variable named ctotal, dtotal, ptotal.
- Prompt the user to enter the number of cats and store it in
the variable cat.
- Prompt the user to enter the number of dogs and store it
in the variable dog.
- Prompt the user to enter the price per cat and store it in
the variable catp.
- Prompt the user to enter the price per dog and store it in
the variable dogp.

 
 
 
 
 
 
 
- Calculate the price for all the cats in the store and store it
in ctotal.
- Calculate the price for all the dogs in the store and store it
in dtotal.
- Calculate the total cost of all the pets in the store and
store it in ptotal.
- Output the store information as in the screen shot below.
- The output should be formatted neatly as shown in the
example below, make sure to test with smaller and then
larger number to ensure that the alignment is proper (5 or
5000 or each pet, price of 2.5 or 50000 per pet).
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education