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).
18. Modify
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Modern Database Management
Degarmo's Materials And Processes In Manufacturing
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
- For this exercise, please calculate two values from all of the numbers in the two dimensional array. The first value should be the sum of all numbers in the array. This should be stored in a separate "int" variable that is created outside the nested FOR loops. The second value should be the total average of all numbers in the Array. This should be stored in a separate "float" variable, also outside the nested FOR loop structure. So, in short: • Display the sum of the values in the array • Then display the average of the values in the array Please refer to the sample output below for visualization and match its style. As always: • Remember, the class name should be Lab9B. The user input is indicated in bold. Sample Output #1: Please enter the number of rows: 3 Please enter the number of columns: 2 I have 3 rows and 2 columns. I need to fill-up 6 spaces. The 3x2 array: 1|2| 314| 516| The sum of all the numbers in the 3x2 array: 21 The average of all the numbers in the 3x2 array: 3.5…arrow_forwardJAVA I cannot figure this one out no matter what I do I cannot get it to run. Please write it in a student way not in an too advance way. Write an application containing three parallel arrays that hold 10 elements each. The first array hold four-digit student ID numbers, the second array holds first names, and the third array holds the students’ grade point averages. Use dialog boxes to accept a student ID number and display the student’s first name and grade point average. If a match is not found, display an error message that includes the invalid ID number and allow the user to search for a new ID number.arrow_forwardwrite a (GUI) application that asks a user how many integers to be entered, then stores the integers in an array. Allow the user to enter all or a portion of the total integers. Display the integers from first to last, and then display the integers from last to first. Display the minimum and maximum numbers as well as the total and average of the numbers.arrow_forward
- this practice assignement wants me to Write an application that contains an array of 10 multiple-choice quiz questions related to your favorite hobby. Each question contains three answer choices. Also create an array that holds the correct answer to each question—A, B, or C. Display each question and verify that the user enters only A, B, or C as the answer—if not, keep prompting the user until a valid response is entered. If the user responds to a question correctly, display Correct!; otherwise, display The correct answer is and the letter of the correct answer. After the user answers all the questions, display the number of correct and incorrect answers here is my new code! i need help to get it to working : import java.util.*;public class Quiz {public static void main(String args[]){String questions[]=("1.What is my favorite hobby?\n" + "(a)hair\n(b)makeup\n(c)both a and b\n", "2.Who first discovered makeup?\n" +"(a)Egyptians\n(b)haitians\n(c)Africans", "3.What glue is best to use…arrow_forwardin 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_forwardthis practcie assignment wants me to Write an application that contains an array of 10 multiple-choice quiz questions related to your favorite hobby. Each question contains three answer choices. Also create an array that holds the correct answer to each question—A, B, or C. Display each question and verify that the user enters only A, B, or C as the answer—if not, keep prompting the user until a valid response is entered. If the user responds to a question correctly, display Correct!; otherwise, display The correct answer is and the letter of the correct answer. After the user answers all the questions, display the number of correct and incorrect answers . how do i create arrays help!! here is my code that i have so far : import java util.Scanner;public class Quiz {public static void main(String[] args) {Scanner input = new Scanner(System.in);System.out.println("What is my favorite hobby?\n" + "(a)hair\n(b)makeup\n(c)both a and b\n");System.out.println("Who first discovered makeup?\n"…arrow_forward
- The 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_forwardIn visual basic Write the code that will sequentially search through the array strFirstNames and will print out the word "Found" if the name "Brian" is in the array.arrow_forwardCreate a program that will ask the user to input the average temperature a day and store it in an Array. Your array should contain days in a week and temperature each day. Display the average temperature in a week, and the day(s) with the highest temperature and lowest temperature.arrow_forward
- Create all possible outcomesarrow_forwardThe intNum array is declared as follows: Dim intNum(,) As Integer = {{6, 12, 9, 5, 2}, {35, 60, 17, 8, 10}}. The intNum(1, 4) = intNum(1, 2) - 5 statement will _____________________. a. replace the 10 amount with 12 b. replace the 5 amount with 7 c. replace the 2 amount with 4 d. None of the above.arrow_forwarda class with 10 students that will take 3 exams use 3 arrays to hold the scores for each student and anoither array to hold the average of the 3 exams for each student. Print the table with the scores and averagearrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming 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