EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 1, Problem 14RQ
Program Description Answer
In Java program, “dots” are used to separate classes, objects and methods.
Hence, correct answer is option “D”.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Create a java class name is Bugs that have
Instance variables
Constructors
Automatic code generation
Accessor Methods
Mutator Methods
move method
turn method
Bug Class: a bug has a code, original location at a point with integer coordinates, faces north, east,south, or west and keeps a record of all its current movement position. The class generate a uniquecode for each new “bug” object created starting with value “b-100”. It also includes the followingmethods:- A default constructor that initializes bug’s code to “b-xxx”; where “xxx” is the next codesequence number in the class, positions to (0,0), and direction to WEST.- A constructor that is given bug’s information: starting location, facing direction and generatesbug code similarly to the default constructor.- Accessor methods to access all the instance variables and the simulated movements of thebug.- Mutator methods that change the instance variables to given values and they make the changefor only suitable values.- turn method…
Please create a java class that contains the following data attributes and methods:
private int customerNumber - a unique number assigned to each customer
private String firstName - the customer's first name
private String lastName - the customer's last name
private float balance - the customer's balance
get/set Methods for each data attribute
public String toString() - Special method to be used when printing a customer Record object
This code is in java.
Craps.java file is your main file.
1) you need to make a Die.java file
This file will have a constructor method that creates a 6-sided die and another method that rolls the die and returns its value.
2) in the Craps.java
Ask the user if they want to play the pass line or the don’t pass line.
Create your die objects
Roll the dice.
Find the sum.
Print out the dice values and the sum ( 1 + 3 = 4).
Determine if the player wins or loses on the first roll (based on pass or don’t pass) or if they rolled the point value.
If they win on the first roll print out you won
If they lose on the first roll print out you lose
Otherwise print out the point value. (for don’t pass, you need to take into account a tie.)
Chapter 1 Solutions
EBK JAVA PROGRAMMING
Ch. 1 - Prob. 1RQCh. 1 - Prob. 2RQCh. 1 - Prob. 3RQCh. 1 - Prob. 4RQCh. 1 - Prob. 5RQCh. 1 - Prob. 6RQCh. 1 - Prob. 7RQCh. 1 - Prob. 8RQCh. 1 - Prob. 9RQCh. 1 - Prob. 10RQ
Ch. 1 - Prob. 11RQCh. 1 - Prob. 12RQCh. 1 - Prob. 13RQCh. 1 - Prob. 14RQCh. 1 - Prob. 15RQCh. 1 - Prob. 16RQCh. 1 - Prob. 17RQCh. 1 - Prob. 18RQCh. 1 - Prob. 19RQCh. 1 - Prob. 20RQCh. 1 - Prob. 1PECh. 1 - Prob. 2PECh. 1 - Prob. 3PECh. 1 - Prob. 4PECh. 1 - Prob. 5PECh. 1 - Prob. 6PECh. 1 - Prob. 7PECh. 1 - Prob. 8PECh. 1 - Prob. 9PECh. 1 - Prob. 10PECh. 1 - Prob. 11PECh. 1 - Prob. 12PECh. 1 - Prob. 1DECh. 1 - Prob. 1GZCh. 1 - Prob. 1CPCh. 1 - Prob. 2CP
Knowledge Booster
Similar questions
- Python Programming Questions (OOP): Write a class named “Bicycle” that has the following instance variables: gear, speed and brakes. This class will as well have the following methods: changeGearUp, changeGearDown, speedup, speedDown, applyBrakes, and printStates. The printStates method can print all of the current attributes of the bike object and brakes can be a Boolean type. Create an object named bike and test some of your methods/code that you have written with some output delivered to the user.arrow_forwardA __________ is code that describes a particular type of object. a. namespace b. blueprint c. schema d. classarrow_forwardjava code"User interface" create a main class called MainUI code a method called startRobots,which will decleare and initialise the following 2 robots:kuratas 1350 and megabot 1700 print the toString to display the details of both robots to the user(use JOptionpanel) code a method called startBooks which will create the following two instances of books and display them to the user (using JOptionpane) title:hello world,author:ada,copies:120 title:it ,author;study ,copies:1 in the main method write code to display a menu option prompting the user to choose which program to run as follows press 1 to view:Robots press 2 to view:Books press 0 to: Exitarrow_forward
- Create an application named SalesTransactiobDemo that declares several SalesTransaction objects and displays their values and their sum. Name - The salesperson name (as a string) sales Amount- The sales amount (as a double) commission- The commission (as a double) RATE- A readonly field that stores the commission rate (as a double). Define a getRate() avcessor method that returns the RATE Include 3 constructors for the class. One constructor accepts values for the name, sales amount, and rate, and when the sales value is set, the constructor computes the commission as sales value times commission rate. The second constructor accepts a name and sales amount, but sets the commission rate to 0 The third constructor accepts a name and sets all the other fields to 0arrow_forwardGiven two integers that represent the miles to drive forward and the miles to drive in reverse as user inputs, create a SimpleCar object that performs the following operations: Drives input number of miles forward Drives input number of miles in reverse Honks the horn Reports car status The SimpleCar class is found in the file SimpleCar.java. Ex: If the input is: 100 4 the output is: beep beep Car has driven: 96 miles // Simulates a simple car with operations to drive and check the odometer.public class SimpleCar { // Number of miles driven private int miles; public SimpleCar(){ miles = 0; } public void drive(int dist){ miles = miles + dist; } public void reverse(int dist){ miles = miles - dist; } public int getOdometer(){ return miles; } public void honkHorn(){ System.out.println("beep beep"); } public void report(){ System.out.println("Car has driven: " + miles + " miles"); } }arrow_forwardjava When we create an object of a class, the object's instance variables are automatically initialized with its default values without us writing code in any constructor. Choose one of the options:TrueFalsearrow_forward
- 1. Method overloading distinguishes between methods based on _____. data types of arguments none of these number of arguments both number of arguments and data types of arguments 2. In Java, when you divide an int by another int, the result will be a(n) _____. int double none of these String float boolean Please give proper explanation and typed answer only.arrow_forwardIN Python Create a class called Student that has the following attributes:• __first_name• __last_name• __final_scoreThe class should have following methods:• letter_grade: calculates the letter grade based on final• display_student_info: displays student informationWrite a Python program that creates at least five objects based on Student class. Use display_student_info method to print each object’s information as output including letter grade. Please modify the class if you think letter_grade needs to be stored as well for a class objectarrow_forwardIn Java create the following: Design a Ship class that the following members: A field for the name of the ship (a string) A field for the year that the ship was built (a string) A constructor and appropriate accessors and mutators A toString method that displays the ship’s name and the year it was built Design a CruiseShip class that extends the Ship class. The CruiseShip class should have the following members: A field for the maximum number of passengers (an int) A constructor and appropriate accessors and mutators A toString method that overrides the toString method in the base class The CruiseShip class’s toString method should display only the ship’s name and the maximum number of passengers Design a CargoShip class that extends the Ship class. The CargoShip class should have the following members: A field for the cargo capacity in tonnage (an int) A constructor and appropriate accessors and mutators A toString method that overrides the toString method in the base class…arrow_forward
- Each object that is created from a class is called a(n) __________ of the class. a. reference b. example c. instance d. eventarrow_forwardIn Python: Design a class named AutomobileLoan that holds: a loan number make of automobile model of automobile balance of loan Include methods to: set values for each data field displays all the loan information Create the class diagram and write the pseudocode that defines the class. Design an application using pseudocode that: declares two AutomobileLoan objects sets the values of both objects displays the values of both objects Deliverables Class Diagram Pseudocode that defines the class Pseudocode that declares, sets, and displays 2 AutomobileLoan objectsarrow_forward______ are instances of a class.a. Methodsb. Variablesc. Objectsd. Operatorsarrow_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,