Java Programming (MindTap Course List)
9th Edition
ISBN: 9781337397070
Author: Joyce Farrell
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 4, Problem 2RQ
Program Description Answer
If a block exists inside another block, then the blocks are called as “nested”.
Hence, the correct answer is option “D”.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Create an application that accepts employee data interactively. Users might make any of the following errors as they enter data:
The employee number is not numeric, less than 1000 or more than 9999
The hourly pay rate is not numeric, less than R9.00 or more than R25.00
Create a class that stores an array of six usable error message that describe the preceding mistakes; save the file as EmployeeMessages.java. Create an EmployeeException class; each object of this class will store one of the messages. Save the file as EmployeeException.java. Create an application that prompts the user for employee data, and display the appropriate message when an error occurs. If no error occurs, display the message “Valid Employee data”. Save the program as EmployeeDataEntery.java
(in java form)
A constant object must be__________ ; it cannot be modified after it’s created.
Among other things, the purpose of this assignment is to assess the student's ability to
write a program dealing with sorting, arrays, and collections.
seed = 3
Input: Ann Chris chris don don chris chris Bill
Intermediate Results: Ann Bill Chris don
Final Results:
PROGRAM SPECIFICATIONS
don Chris Bill Ann
seed = 4
Beginning with the file that you downloaded named Proj04.java, create a new file
named Proj04Runner.java to meet the specifications given below.
Input: ann Ann Ann Don Don don Chris Chris
Intermediate Results: ann Chris Don
Note that the code in the file named Proj04.java.
Final Results:
ann Don Chris
seed = 5
Input: Ann ann Ann Bill don bill Chris Ann
Intermediate Results: Ann Bill Chris don
Be sure to display your name in the output as indicated.
When you place both files in the same folder, compile them both, and run the file
named Proj04.java with a command-line argument of 6, the program must display
the text shown below on the command line screen.
Final Results:
don…
Chapter 4 Solutions
Java Programming (MindTap Course List)
Ch. 4 - Prob. 1RQCh. 4 - Prob. 2RQCh. 4 - Prob. 3RQCh. 4 - Prob. 4RQCh. 4 - Prob. 5RQCh. 4 - Prob. 6RQCh. 4 - Prob. 7RQCh. 4 - Prob. 8RQCh. 4 - Prob. 9RQCh. 4 - Prob. 10RQ
Ch. 4 - Prob. 11RQCh. 4 - Prob. 12RQCh. 4 - Prob. 13RQCh. 4 - Prob. 14RQCh. 4 - Prob. 15RQCh. 4 - Prob. 16RQCh. 4 - Prob. 17RQCh. 4 - Prob. 18RQCh. 4 - Prob. 19RQCh. 4 - Prob. 20RQCh. 4 - Prob. 1PECh. 4 - Prob. 2PECh. 4 - Prob. 3PECh. 4 - Prob. 4PECh. 4 - Prob. 5PECh. 4 - Prob. 6PECh. 4 - Prob. 7PECh. 4 - Prob. 8PECh. 4 - Prob. 9PECh. 4 - Prob. 10PECh. 4 - Prob. 11PECh. 4 - Prob. 1GZCh. 4 - Prob. 2GZ
Knowledge Booster
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
- Given main(), build a struct called Student that represents a student that has two data members: the student's name (string) and the student's GPA (double). Assume student's name has a maximum length of 20 characters.arrow_forwardAlert dont submit AI generated answer.arrow_forwardPlease do in Java In many computer systems and networks,different users are granted different levels of access to different resources. In this case, you are given a int[] rights, indicating the privilege level of each user to use some system resource. You are also given a int minPermission, which is the minimum permission a user must have to use this resource. You are to return a String indicating which users can and cannot access this resource. Each character in the return value corresponds to the element of users with the same index. 'A' indicates the user is allowed access, while 'D' indicates the user is denied access. Constraints users will contain between 0 and 50 elements, inclusive. Each element of users will be between 0 and 100, inclusive. minPermission will be between 0 and 100, inclusive. Examples a) {0,1,2,3,4,5} 2 Returns: "DDAAAA" Here, the first two users don't have sufficient privileges, but the remainder do. b) {5,3,2,10,0} 20 Returns: "DDDDD"…arrow_forward
- In Java SE netbeans: Extreme IT Products is a local supplier that specialises in the sales of the latest InformationTechnology hardware devices. The business has recently opened an outlet in the town you resideand has hired the software development house you work for to design a Java application tomanage their products.Your line manager has requested you to develop the application with the following requirements: 1.11. When the user selects to view a report, display the product report generated from thearrays in your application. You must create a class called ReportData which will containget and set methods for each item required in the report. Sample Report PRODUCT REPORT ------------------------------------------------------------------------------------------------------------------------------ PRODUCT 1 --------------------------------------------------------------- PRODUCT CODE >> A55 PRODUCT NAME >> Elitebook PRODUCT CATEGORY…arrow_forwardException handling and File I/O coding intellj Exercise 3. File I/O Please create a file and add the following line: 1,5,7,9,13,58,70 Exercise 4, Assuming you have a file on your laptop, and it has the following: John,23 Please create a Person object from your main method by reading the file. You have to create Person class (String name, int age) Please read the file and show the sum of all the numbers.arrow_forwardProject 2 statement ANSWER IN SINGLE FILE JAVAPlease read this entire statement carefully before you start doing anything… This project involves implementing a simple university personnel management program. The program contains three kinds of objects: Staff, student and faculty. For each object, the program stores relevant information such as university ID, name, etc. Different information is stored depending on the type of the object. For example, a student has a GPA, a faculty has a title and department (professor, mathematics).For each of any class data member, your program must include the getters and the setters, and each class must include at least two constructors. The goal of this Project is to demonstrate the use of inheritance, abstract classes, abstract methods, and method overriding. For a student, we need a: full name id gpa Number of credit hours currently taken For a faculty, we need a: full name id department (mathematics, engineering or english) Rank (professor or…arrow_forward
- Modify the code below to create a "Favorite Video Game List" program that is contained in three files: Game.h Game.cpp Game_List.cpp You will need do to these things as you modify the code and put it into the three files: Create a class called "Game" (instead of "Movie") that contains 3 private variables ("title", "year", and "rating") The "year" is when the game first came out. The "rating" should be from 1 to 5 (5 being the best). Add the appropriate member functions of the class (setters and getters). Continue to use the get_title_upper() function as part of the class, Game, and in the output within the main file, Game_List.cpp. Add the Default Constructor for the class with the member functions of the class. Ignore the Destructor code for now. It's there to show you where it ends up in future code. Don't forget to add the include guard to the .h file Use the scope resolution operator correctly for each file. Don't use the "using namespace std;" for the main…arrow_forwardI JIO 4G| 20:46 VOLTE You Just now 8. Design a class called Date that has integer data members to store month, day, and year. The class should have a three-parameter default constructor that allows the date to be set at the time a new Date object is created. If the user creates a Date object without passing any arguments, or if any of the values passed are invalid, the default values of 1, 1, 2001 (i.e, January 1, 2001) should be used. The class should have member functions to print the date in the following formats: 1/15/2016 January 15, 2016 15 January 2016arrow_forwardEach of the following files in the Chapter.02 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugTw01.cs will become FixedDebugTw01.cs. a. DebugTw01.cs b. DebugTw02.cs c. DebugTw03.cs d. DebugTw04.csarrow_forward
- Each of the following files in the Chapter.10 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugTen01.cs will become FixedDebugTen01 .cs. a. DebugTen01.cs b. DebugTen02.cs c. DebugTen03.cs d. DebugTen04.csarrow_forwardfor c++ please need three files employee.h productionWorker.h cpp file NB: NEED ANSWER THE EXCEPTION PROJECT. here is chapter 15 required 15, Employee and ProductionWorker Classes Design a class named Employee. The class should keep the following information in • Employee name • Employee number • Hire date Write one or more constructors and the appropriate accessor and mutator functions for the class. VideoNote Solving the Employee and ProductionWorker Classes Problem Programming Challenges 963 Next, write a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have member variables to hold the following information: • Shift (an integer) • Hourly pay rate (a double ) The workday is divided into two shifts: day and night. The shift variable will hold an integer value representing the shift that the employee works. The day shift is shift 1, and the night shift is shift 2. Write one or more constructors and the appropriate accessor and…arrow_forward2. Name the demo file firstname_lastname_PE2 Create a program that simulates a dumpster diving game. Dumpster diving is when you search for loot in large industrial sized trash bins. In the game you will roll a ten-sided dice to determine what the user has received. Use the UML below as a guide for the Die class (Name the class Die.java). Die - sideUp: int = 10 - value: int + Die() + roll(): void + getvalue(): int Below are some suggestions to aid you in designing the game: • Each round of the game is performed as an iteration of a loop that repeats as long as the player wants to "dive" for more items. • At the beginning of each round, the program will ask the user whether or not he or she wants to continue diving. The program simulates the rolling of a ten-sided die Each item that can be caught is represented by a number generated from the die; for example, 1 for "a half-eaten sandwich", 2 for "a left shoe", 3 for "a broken watch", and so on. • Each item the user catches is worth a…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License