Concept explainers
Explanation of Solution
Given:Â The details of three students:
Snow White, student ID: A00234, credits: 24
Lisa Simpson, student ID: C22044, credits: 56
Charlie Brown, student ID: A12003P, credits: 6
To find:
A way to add three students.
A way to enroll them into labClass.
A way to use printlist() to print all the students of that class.
Solution:
Start BlueJ and then open a new project named lab-classes.
A new window will appear on screen in which each rectangular block will represent a class.
To create object of LabClass class, it is necessary for the user to right click on the LabClass class and then click on the new LabClass (int maxNumberOfStudents) from the pop-up menu. The parameter should be filled and the user can provide a specific name of instance and then click ok button.
A new red rectangle will appear at the bottom of the BlueJ screen labeled with the name of instance provided by the user.
To create object of Student class, it is necessary for the user to right click on the Student class and then click on the new Student (String fullName, String studentID) from the pop-up menu...
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
- VBA PROBLEM: Create a code where every time that only cell B1 is changed, create a new tab and that this tab is renamed with the value that is entered in B1 and the other cells, that is, B2: B11 have the same values that are entered in the Sheet1. The values of A1: A11 must always remain the same. Like in the examples below (image 1 and 2).arrow_forwardWrite a code to the image using Console.WriteLine.arrow_forward02 - Rectangular Prisms Prompt the user for three integers representing the sides of a rectangular prism. Calculate the surface area and volume of the prism, then draw three rectangles of asterisks portraying the top, side, and front view of the prism labeled accordingly (which set of numbers represent each view is at your discretion). Enter three integers: 2 5 6 Surface Area: 104 Volume 60 Top View (2 x 5): Side View (2 x 6): Front View (5 x 6):arrow_forward
- Truth table: Please make sure the truth table is correct and it has no mistakes. Correct the truth table if there are mistakes.arrow_forwardthe huntington high school basketball team has five players named art, bob, cal, dan, and eli. accept the number of points scored by each player in a game and create a bar chart that illustrates the points scored, similar to the chart in figure.arrow_forwardPython question please include all steps and screenshot of code. Also please provide a docstring, and comments through the code, and test the given examples below. Thanks. If there is a vote at a meeting, there are several possible outcomes based on the numberof yes and no votes (abstains are not counted). If all the votes are yes, then the proposalpasses "unanimously", if at least 2/3 of the votes are yes, then the proposal passes with"absolute majority", if at least 1/2 of the votes are yes, then the proposal passes by"simple majority", and otherwise it fails. Write function vote() that takes as input thenumber of yes votes and the number of no votes and then prints the outcome of the vote.>>> votes(9, 0)proposal passes unanimously>>> votes(6, 3)proposal passes with absolute majority>>> votes(5, 4)proposal passes with simple majority>>> votes(4, 5)arrow_forward
- switch_player(): we will allow the players to choose their own names, but for our purposes, it is easier to think of them as number (0 and 1, for indexing purposes). We will display their names to them on the screen, but in the background, we will keep track of them based on their number. This function should take 1 argument, an integer (either 0 or 1) representing the player and should return the opposite integer (1 if 0 is entered and 0 if 1 is entered). This is a simple function, but it will make our code cleaner later. Use your constants! Using Thonnyarrow_forwardComplete the following code as instructed in the line comments. String title = "Dame" name = "Liz taylor", citizenship = "British American"; //Create a StringBuilder object called correctName and send it name. //Capitalize the 't' in "taylor". //Replace "Liz" with "Elizabeth". //Append a comma followed by a space to the object. //Append "you were a famous actress." to the object. //Print the object using an explicit call to toString (). //Use the stringBuilder object to call its toString () explicitly, then call split() to tokenize the String version of the StringBuilder object into an array called message. Use a space as the delimiter or separator. This is all one Java statement. //Code the header for an enhanced for to print the tokens from the message array. The variable to hold each token is called word. { System.out. ("%n%s", ); //Fill-in the correct method to print. Fill-in the correct argument. }//END enhanced forarrow_forward18. This keyword will stop the execution of more code and case testing inside the block. break continue None of the Choices default Give an explanation for the answer. Thank youarrow_forward
- Extra 7-2 Add a stopwatch to the Clock application In this exercise, you’ll add a stopwatch feature to a digital clock application. The stopwatch will display elapsed minutes, seconds, and milliseconds. 1. Open the application in this folder: exercises_extra\ch07\clock_stopwatch\ 2. In the JavaScript file, note the $(), displayCurrentTime(), padSingleDigit(), and DOMContentLoaded event handler functions from the Clock application. In addition, note the global variables and starting code for the tickStopwatch(), startStopwatch(), stopStopwatch(), and resetStopwatch() functions. 3. In the tickStopwatch() function, add code that adds 10 milliseconds to the elapsedMilliseconds variable and then adjusts the elapsedMinutes and elapsedSeconds variables accordingly. Then, add code that displays the result in the appropriate span tags in the page. 4. In the startStopwatch() function, add code that starts the stopwatch. Be sure to cancel the default action of the link too. 5. In the…arrow_forwardQ3: Lecture Hall Dan holds his CSC108 lectures in a rectangular N X M lecture hall. In other words, this lecture hall has N rows of seats, each of them containing exactly M seats. Here's my attempt at drawing this layout when N = 3 and M = 5: Dan Off 00 lecture hall layout with 3 rows and 5 seats per row The rows are numbered from 1 to N starting from the front row. Similarly, the columns are numbered from 1 to M starting from the leftmost column. We write (r, c) to denote the c-th seat in the r-th row. When Dan walks into the lecture hall this morning, some of the seats are already taken (this is the initial layout of the lecture hall). After that, the students come in one group at a time. From experience, Dan knows that when a group of K students enter the lecture hall, they look for K consecutive empty seats. That is, they try to find an empty seat (r, c) such that for all integers i in [0, K-1], the seat (r, c + 1) exists and is empty. If they can't find K consecutive empty seats,…arrow_forwardExtra 6-1 Develop the Temperature Converter In this exercise, you’ll use radio buttons to determine whether the conversion is from Fahrenheit to Celsius or vice versa. You’ll also modify the DOM so the labels change when a radio button is clicked, and the page displays an error message when the user enters invalid data. 1. Open the application in this folder: exercises_extrach06convert_temps 2. Note that the JavaScript file has some starting JavaScript code, including the $() function, three helper functions, three event handler functions, and a DOMContentLoaded event handler that attaches the three event handlers. 3. Review how the toCelsius() and toFarhenheit() event handler functions call the toggleDisplay() helper function and pass it strings to display. Also note that the toggleDisplay() helper function and the convertTemp() event handler function are incomplete. 4. Code the toggleDisplay() function so it changes the text in the labels for the text boxes to the values in the…arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,