Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
6th Edition
ISBN: 9780134477367
Author: David J. Barnes, Michael Kolling
Publisher: PEARSON
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 1, Problem 27E

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...

Blurred answer
Students have asked these similar questions
Create three students with the following details: Snow White, student ID: A00234,credits: 24 Lisa Simpson, student ID: C22044,credits: 56 Charlie Brown, student ID: A12003,credits: 6 Then enter all three into a lab and print a list to the screen.
Create a list that contains 10 words and their descriptions. Your task is to have the application randomly select a word from the list and display the description to the user. User will then try to guess the word based on the clue displayed. One round of game is five chances. Once the total number of chances becomes zero, the program should prompt the user whether to keep playing or exit the application.
Question-2: You work at an IT company, and you have been asked to design a simple chatbot that takes orders. The chatbot will keep asking for an item and its quantity until the customer types “Complete". Then, it will set a price for each item depending on the length of the item's name and multiplying it with the quantity. Finally, it will print the whole list with the individual prices and summed prices, and finally, print the total amount. If no item was added, print "Nothing in the list". Hint: Use a dictionary to save the items and their quantities. Sample Input 1: Please enter item 1: Apple Please enter the quantity: 3 Please enter item 2: Orange Please enter the quantity: 4 Please enter item 3: Complete Sample output 1: The complete list is: Apple - 5 - 15 Orange - 6 - 24 {'Apple': [5, 15], 'Orange': [6, 24]} Total price = 39
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,