Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercises --------------------------------------------------------------------------------------- 1. a. Design the logic for a program that allows a user to enter 15 numbers, then displays them in the reverse order

Exercises --------------------------------------------------------------------------------------- 1. a. Design the logic for a program that allows a user to enter 15 numbers, then displays them in the reverse order of entry. b. Modify the reverse-display program so that the user can enter any amount of numbers up to 15 until a sentinel value is entered. --------------------------------------------------------------------------------------- 2. a. Design the logic for a program that allows a user to enter 10 numbers, then displays each number and its difference from the numeric average of the numbers entered. b. Modify the program in Exercise 2a so that the user can enter any amount of numbers up to 10 until a sentinel value is entered. ----------------------------------------------------------------------------------------- 3. a. Registration workers at a conference for authors of childrens books have collected data about conference participants, including the number of books each author has written and the target age of their readers. The participants have written from 1 to 40 books each, and target readers ages range from 0 through 16. Design a program that continuously accepts the number of books written until a sentinel value is entered, and then displays a list of how many participants have written each number of books (1 through 40). b. Modify the author registration program so that a target age for each author's audience is input until a sentinel value is entered. The output is a count of the number of books written for each of the following age groups: under 3, 3 through 7, 8 through 10, 11 through 13. and 14 and older. -------------------------------------------------------------------------------------- 4 a. The Downdog Yoga Studio offers five types of classes, as shown in Table 5-2. Design a program that accepts a number representing a class and then displays the class name. b. Modify the Downdog Yoga Studio program so that numeric class requests can be entered continuously until a sentinel value is entered. Then, display each class number, name, and a count of the number of requests for each class. Downdog Yga Studc Class Number Class Name 1 Yoga 1 2 Yoga 2 3 Children's Yoga 4 Prenatal Yoga 5 Senior Yoga classes ------------------------------------------------------------------------------------------ Case:

Case; The Barking Lot

3. In earlier chapters, you developed programs for The Barking Lota dog-boarding facility.

--------------------------------------------------------------------------------------------- Create an application that prompts the user for a dogs ID number and the number of days the dog will be boarded. Any time the user enters an invalid value, continue to reprompt the user for the same data. Invalid values are: An ID number for the dog that is less than 1000 or greater than 1999 A number of days for boarding that is not between 1 and 31 inclusive When the user enters a dogs ID. determine the dogs name and weight from Table 5-16. If the dog's ID does not appear in the table, prompt the user for the name and weight Use Table 5-17 to determine the base price for boarding the dog based on CHAPTER 5 Arrays the length of stay. Then determine the additional fee per day based on the dogs weight, as shown in Table 5-18. irrad Dog IDs and weights tot The Barfang Lot ID Dog Weight 1001 Bowser 130 1003 Ginger 80 1007 Moly 45 1008 Tyler 18 1012 Roxy 70 Addrtional price per day based on weight of dog Length of Stay In Days Price per Day ($) 1-3 28.00 4-8 24.00 9-20 20.00 21 and up 17.50 EWffESn Price per day of boarding based on length of stay for The Barking Lot Dog's Weight in Pounds Additional Price ($) Linder 15 0.00 16-40 2.00 41-80 3.00 81 and over 3.50 When all the needed data has been entered correctly for a dog. output all the data, including the ID number, dogs name and weight, length ofstay, base price per day. additional price per day based on weight, and total amount due

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions