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)
- the information for the 3 objects you need to create is listedbelow:Description Brand Units in Inventory Unit PriceItem #1 Jacket REI 12 130.95Item #2 Designer Jeans Levi 40 34.95Item #3 Shirt Nike 20 24.956. After storing the items as objects, calculate the total price for eachitem (units x unit price) then display the items as shown in thetable above but with an additional column titled “Total Price” thatdisplays the total price the program has calculated for each item. pythonImage below shows how information is to be displayedarrow_forwardswitch_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_forwardPlease adjust the calculator so that whenever the person enters their name and enters the input. It says for example “Peter, you are clinically obese” Please also add the findings to the right side of the page next to the BMI calculator.arrow_forward
- the 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_forwardSubmission Instructions Follow the instructions for How to Submit Programming Assignments. Assignment First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create a new Java application called "PatternMaker" (without the quotation marks) according to the following guidelines. The program prompts the user for five input values: An integer value between 1 and 10 (inclusive) for the number of rows to be printed A second integer value between 1 and 10 (inclusive) for the number of columns to be printed A string value for the starting string of the pattern A string value for the second string of the pattern A string value that separates the first two strings The program must use nested for loops to print a rectangular array of alternating first and second strings of the pattern, separated by the separator string and such that the first string in the first row uses the "first string" provided by the user, but…arrow_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
- 1. The main function creates 5 pixels with random red, green, and blue values. Complete the id_color function to return “red” if the red value is greater than the green and blue, “green” if the green value is greater than the red and blue, and “blue” if the blue value is greater than the red and green. If there is no clear maximum value (for example, if the red and green values are the same) return None. Do not change the main function. import imageimport random def id_color(p):'''Returns the dominant color of pixel p'''pass#Your code here to determine the dominant color and return a string identifying it#Hint: get the red, green & blue values and use an if statement to determine which has the highest value def main():'''Controls the program'''for i in range(5): #Loop 5 timesr = random.randrange(0, 256)g = random.randrange(0, 256)b = random.randrange(0, 256)print(r, g, b) #Show the pixel red, green & blue valuesnew_pixel = image.Pixel(r, g, b)print(id_color(new_pixel)) main()…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_forwardYour soccer team is holding a silent auction dinner as a fundraiser to pay for the team uniforms. The list shows all the expenses for the silent auction. A tablet that costs $280 Soccer tickets that cost $100 A gift card that costs $20 The cost of the food is $400 The members of the soccer team will be selling tickets to the silent auction. A ticket to the silent auction includes chances to win prizes and dinner. The ticket cost is set so that 50 tickets will pay for the cost of the prizes and food. Build a function that can be used to find the total profit, f(x)f(x), the soccer team earns by selling xx tickets. Show your work to build this function. and Your soccer team needs to raise at least $500 more than the total cost of the expenses. What is the minimum number of tickets that must be sold in order for your team to reach their goal? Use mathematics to justify your answer.arrow_forward
- OBAFGKM are the seven categories that are used to describe the absorption lines of a spectrum. Access the Spectral Types Color Slider by opening the Eclipsing Binary Stars section of the NAAP Labs Application and then the Spectral Types of Stars subsection (it is the last simulation on the page) and use it to complete the data table below. Spectral Type: include a letter and a number (no space). Temperature: Kelvin (K) is assumed for Temperature. Color: choose from Blue, White, Orange, or Red (spelling counts!).arrow_forward1. The main function creates 5 pixels with random red, green, and blue values. Complete the id_color function to return “red” if the red value is greater than the green and blue, “green” if the green value is greater than the red and blue, and “blue” if the blue value is greater than the red and green. If there is no clear maximum value (for example, if the red and green values are the same) return None. Do not change the main function.arrow_forwardWrite your first name in the red part You Last name should appear in the empty label after you click on "My last name is” Button Use .place() package • window.geometry("300x200+10+10") def Print(): This is Amrou My Last name is This is Amrou My Last name is Haj Ibrahimarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education