Concept explainers
Your swim school has two swimming instructors, Jeff and Anna. Their current schedules are shown below. An “X” denotes a 1-hour time slot that is occupied with a lesson.
Write a program with array(s) capable of storing the schedules. Create a main menu that allows the user to mark a time slot as busy or free for either instructor. Also, add an option to output the schedules to the screen. Next, add an option to output all time slots available for individual lessons (slots when at least one instructor is free). Finally, add an option to output all time slots available for group lessons (when both instructors are free).
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Database Concepts (8th Edition)
Starting Out with Python (4th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Concepts Of Programming Languages
- in C#, Visual Basic Write an app for Boston Airlines that allows a customer to reserve a seat on the airline’s only plane (capacity: 10 seats). Radio buttons should allow the choice between First Class and Economy. The app should then assign a seat in the first-class section (seats 1–5) or the economy section (seats 6–10). Use a one-dimensional array of type bool to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. As each seat is assigned, set the corresponding element of the array to true to indicate that the seat is no longer available. Your app should never assign a seat that has already been assigned. When the economy section is full, your app should ask the person if it is acceptable to be placed in the first-class section (and vice versa). If yes, make the appropriate seat assignment. If no, display the message “Next flight leaves in 3 hours."arrow_forwardThe Chat-A-While phone company provides service to six area codes and charges the per-minute rates for phone calls shown in Figure 6-25 (below). Write a program named ChatAWhile that stores the area codes and rates in parallel arrays and allows a user to enter an area code and the length of time for a call in minutes, and then display the total cost of the call. For example if the area code is in the array, such as 715, and the call length is 22 minutes, the output should be: Your phone call to area 715 costs $0.16 per minute For 22 minutes the total is $3.52 If the area code is not in the array, such as 111, the program should not accept a call length, and instead output Sorry - no calls allowed to area 111. Area Code Per-Minute Rate ($) 262 0.07 414 0.10 608 0.05 715 0.16 815 0.24 920 0.14 Figure 6-25 Per-minute phone call rates In order to prepend the $ to currency values, the program will need to use the CultureInfo.GetCultureInfo method. In order to do this,…arrow_forwardCreate a class called WashingMachine with a float called CubicFeet, a string called brandName, and a method called Washing. The Washing method should return a string to the main class with the text "Now washing clothes!" In the main class create an array of WashingMachine size 5. Give each WashingMachine a different brand and CubicFeet. Use a foreach loop to display that info, call the Washing method, and display the text returned from the Washing method call. in C#arrow_forward
- Create a game similar to Hangman named GuessAWord in which a player guesses letters to try to replicate a hidden word. Store at least eight words in an array, and randomly select one to be the hidden word. (The statements needed to generate a random number are shown in the Exercises in the “Decision Making” and “Looping” chapters.) Initially, display the hidden word using asterisks to represent each letter. Allow the user to guess letters to replace the asterisks in the hidden word until the user completes the entire word. If the user guesses a letter that is not in the hidden word, display an appropriate message. If the user guesses a letter that appears multiple times in the hidden word, make sure that each correct letter is placed. The program should be done in C#arrow_forwardSuppose a teacher has five students who have taken four tests. The teacher uses the following grading scales to assign a letter grade to a student, based on the average of his or her four test scores. Test Score Letter Grade 90-100 80-89 70-79 60-69 0-59 A B C D F Create an application that uses an array of strings to hold the five student names, an array of five strings to hold each student's letter grades, and five arrays of four single precision numbers to hold each student's set of test scores.arrow_forwardPls, explain how this program question applies to the code below and comment on it in the program. for example, comment the which part of the question applies to the code and how it worksarrow_forward
- Create an application containing an array that stores eight integers. The application should call five methods that in turn (1) display all the integers, (2) display all the integers in reverse order , (3) display the sum of the integers, (4) display all values less than a limiting argument, and (5) display all values that are higher than the calculated average value.arrow_forwardCreate a program named student2.java This program will differ from program 1 in that it will use three arrays to store student id, names and grades. Store the data in the array in sequence as it is entered. Make room for 100 students. Otherwise this program should do all of the same tasks that are required in program 1. Add a comment to the end of your code file with the following: What is the O() of the display() and classavg() methods. What is the O() of the findid() method. Compare the big O() values between the first program and the second.arrow_forwardWrite an application that displays a series of at least five student ID numbers (that you have stored in an array) and asks the user to enter a numeric test score for the student. Create a ScoreException class, and throw a ScoreException for the class if the user does not enter a valid score (less than or equal to 100). Catch the ScoreException and then display an appropriate message. In addition, store a 0 for the student’s score. At the end of the application, display all the student IDs and scores. Save the files as ScoreException.java and TestScore.java.arrow_forward
- You are a manager of a Wally's Training Gym and you encourage your trainers to enroll new members. Input is the trainer's last name and the number of new enrollees. Output is the number of trainers who have enrolled members in each of three categories: 0-5 new members, 6-10 new members, and 11 to 15 new members. Write an application that allows the user to enter 15 Trainer's names and the number of new members they have enrolled into an array. Output is to display the number of trainers who are in each category. Use good programming techniques that you have learned throughout the course. Use appropriate variable names, use an array to store the names and number of new enrollees, and use prompts for the input and labels with the display. Turn in your Raptor file by clicking on the Start Here button in the upper right corner of your screen.arrow_forwardCreate a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the priceof a seat in economic class and the number of seats booked.Declare an array to store at least 30 Booking structs. The user must be able to enter the information for a number of bookings from the keyboard. Ask whether abooking must be made (Y or N). If a booking must be made, a random 3 digit flight number must be generated.The user must be asked to enter the type of seat, the price per seat and the number of seats to book. Example of input: Make a booking (Y or N): Y Type of seat (E or B): e Price per seat : 1200 Number of seats: 2 Make another booking (Y or N): y Type of seat (E or B): b Price per seat : 3400 Number of seats: 2 Make another booking (Y or N): y Type of seat (E or B): e Price per seat : 1400 Number of seats: 3 Make another booking (Y or N): y Type of seat (E or B): e Price per seat : 1300 Number of seats: 2 Make another booking (Y or N): y Type of…arrow_forwardYou are a manager of a Wally's Training Gym and you encourage your trainers to enroll new members. Input is the trainer's last name and the number of new enrollees. Output is the number of trainers who have enrolled members in each of three categories: 0-5 new members, 6-10 new members, and 11 to 15 new members. Write an application that allows the user to enter 15 names and the number of new members they have enrolled into an array. Output is to display the number of trainers who are in each category. Use good programming techniques that you have learned throughout the course. Use appropriate variable names, use an array to store the names and number of new enrollees, and use prompts for the input and labels with the display.arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning