EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3, Problem 18RQ
Program Description Answer
Before storing data in the object myJournal memory should be allocated for it explicitly.
Hence, the correct answer is option “A”.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
A constant object must be__________ ; it cannot be modified after it’s created.
Create an object prototype called Gradebook that will pass an array of grades for a student as a parameter.
- Create a boolean in Gradebook madeHonourRoll that will check whether or not the student has made honour roll
- Create a function within Gradebook, that will calculate the average of the grades passed
- Create a function outside of Gradebook, that will check if the grades are over an 80% average. Return madeHonourRoll as true if the student has made over 80% average.
- Create a function outside Gradebook, called toString(), that will output to console whether or not the student has made the honour roll.
Introduction
In this project, you will complete a C++ class by writing a copy constructor, destructor, and assignment
operator. Furthermore, you will write a tester class and a test program and use Valgrind to check that
your program is free of memory leaks. Finally, you will submit your project files on GL. If you have
submitted programs on GL using shared directories (instead of the submit command), then the
submission steps should be familiar.
In this project we develop an application which holds the information about a digital art piece. There
are two classes in this project.
• The Random class generates data. The implementation of this class is provided. It generates
random int numbers for colors. To create an object of this class we need to specify min and max
values for the constructor. The colors fall between 30 and 37 inclusively.
The Art class generates random colors and stores the color values. You implement the Art class.
An object of the Art class is a digital masterpiece.…
Chapter 3 Solutions
EBK JAVA PROGRAMMING
Ch. 3 - Prob. 1RQCh. 3 - Prob. 2RQCh. 3 - Prob. 3RQCh. 3 - Prob. 4RQCh. 3 - Prob. 5RQCh. 3 - Prob. 6RQCh. 3 - Prob. 7RQCh. 3 - Prob. 8RQCh. 3 - Prob. 9RQCh. 3 - Prob. 10RQ
Ch. 3 - Prob. 11RQCh. 3 - Prob. 12RQCh. 3 - Prob. 13RQCh. 3 - Prob. 14RQCh. 3 - Prob. 15RQCh. 3 - Prob. 16RQCh. 3 - Prob. 17RQCh. 3 - Prob. 18RQCh. 3 - Prob. 19RQCh. 3 - Prob. 20RQCh. 3 - Prob. 1PECh. 3 - Prob. 2PECh. 3 - Prob. 3PECh. 3 - Prob. 4PECh. 3 - Prob. 5PECh. 3 - Prob. 6PECh. 3 - Prob. 7PECh. 3 - Prob. 8PECh. 3 - Prob. 9PECh. 3 - Prob. 10PECh. 3 - Prob. 11PECh. 3 - Prob. 12PECh. 3 - Prob. 13PECh. 3 - Prob. 1GZCh. 3 - Prob. 2GZCh. 3 - Prob. 1CP
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
- Q3: You are designing a program for storing information about Computers. There are different types of computer for different purposes. Create a class Computer which will have attributes: CPUName=string, CPUClockSpeed_ghz-float, memory_gb3float. Now derive two classes from the Computer class, PC which will have attributes: operatingSystem3string, model=int, hasGPU=boolean and second class will be Smartphone which will have attributes: OSversion=string, battery_mAH=int. Write following functions for each class: > Constructor/Destructor > Deep Copy Constructor Parameterised Constructor Getter/Setter for dimension and length/radius Function to write the information to data file in append mode. Write a main function to create a dynamic array of PC and smartphone. Also write a function to get the PC with max CPUClockSpeed_ghz. Note: Write those functions which are asked. Be Precise in your answer.arrow_forwarddesign a Club class and use it to create an application that simulates asoccer league tournament. You are not limited to the features included in these instructionsDesign the Club class, to be used in your application, containing: A private data member code of type string that holds the three letters club’s abbreviation(ex, FCB, LIV, RAM ...) A private data member name of type string that holds the club’s name (ex, FC Barcelona,Liverpool, Real Madrid …) A private data member round of type integer that holds the number of rounds the club hasplayed so far in the current league. A private data member wins of type integer that holds the number of times the club haswon in the current league. A private data member draws of type integer that holds the number of times the club hasbeen drawn in the current league. A private data member losses of type integer that holds the number of times the club haslost in the current league. A private data member goals of type integer that holds the…arrow_forwardAn n-sided regular polygon’s sides all have the same length and all of its angles have the same degree (i.e., the polygon is both equilateral and equiangular). Design a class named RegularPolygon thatcontains:■ A private int data field named n that defines the number of sides in the polygon.■ A private float data field named side that stores the length of the side.■ A private float data field named x that defines the x-coordinate of the center of the polygon with default value 0. ■ A private float data field named y that defines the y-coordinate of the center of the polygon with default value 0.■ A constructor that creates a regular polygon with the specified n (default 3),side (default 1), x (default 0), and y (default 0).■ The accessor and mutator methods for all data fields.■ The method getPerimeter() that returns the perimeter of the polygon.■ The method getArea() that returns the area of the polygon. The formula for computing the area of a regular polygon is Area = (n * s2) / (4 *…arrow_forward
- question in javascript Create an object prototype called Gradebook that will pass an array of grades for a student as a parameter. - Create a boolean in Gradebook madeHonourRoll that will check whether or not the student has made honour roll - Create a function within Gradebook, that will calculate the average of the grades passed - Create a function outside of Gradebook, that will check if the grades are over an 80% average. Return madeHonourRoll as true if the student has made over 80% average. - Create a function outside Gradebook, called toString(), that will output to console whether or not the student has made the honour roll.arrow_forwardAn object is a(n) _____________________ of a class Select one: a. instantiation b. relative c. child d. institutionarrow_forwardThere is a class team ,that holds information about the team name, number of players in the team,and player's code.design the constructor function that decides the number of player in the team and intializes code for each player.create a team and display it's all data.( Implement dynamic memory allocation).arrow_forward
- class Binary: def __init__(self, value = 0): def __str__(self): pass def b_to_d(self): pass def d_to_b(self,v): """ HINT: Does not modify any instance variables """ pass def __add__(self, other): pass def __sub__(self,other): pass def __mul__(self,other): pass def __neg__(self): pass def __abs__(self): pass def __len__(self): pass python i want to code this class to deal with binary and decemial int() and bin are not allowed one possible out put should be x=Binary(0) print(x) b0 a=Binary(9) print(a) b1001arrow_forwardUsing JAVA An account record has the following:Account nameAccount surnameAccount numberAccount typeInterestBalance Create an AccountRecord class, complete with accessors and mutators (get and set methods) for theinstant variables as well as the toString method for formatting the object.The Account Record class must have an abstract method called calculateinterest A savings account must have a minimum balance of R500 and has an annual interest of 5%, If thebalance is greater than R10000 the annual interest is 7% and if the balance is greater than R50000 theannual interest is 8%An investment account must have a minimum balance of R100000 and the annual interest is 9%,Withdrawals cannot be made on an investment account.A check account can have a minimum balance of RO. The annual interest is 2% if the balance is greaterR20000. If the balance is greater than R100000 the annual interest can be 4%Each of the subclasses must have at least two constructors.The savings account, investment…arrow_forwardThis program is based in Java, so the response has to be java. Movie Collection Program Create a program that keeps track of your movie collection. Your driver file is movieCollection You will use it to create 4 movie objects. Your Movie class should have a default constructor that does not receive any values and sets all information to default values. You should also have an overload constructor method that has all of the data passed into it. The following information is what each movie object should have: Title Genre Year of release Director. You should have mutator methods that let you set all pieces of information individually. You should have accessor methods that allow you to get each piece of information individually. You should have a toString method that prints out all of the information about a movie at one time. Each piece of information should be on its own line. In the movieCollection file Movie one should be created using the default constructor.…arrow_forward
- Using JAVA An account record has the following:Account nameAccount surnameAccount numberAccount typeInterestBalance Create an AccountRecord class, complete with accessors and mutators (get and set methods) for theinstant variables as well as the toString method for formatting the object.The Account Record class must have an abstract method called calculateinterest A savings account must have a minimum balance of R500 and has an annual interest of 5%, If thebalance is greater than R10000 the annual interest is 7% and if the balance is greater than R50000 theannual interest is 8%An investment account must have a minimum balance of R100000 and the annual interest is 9%,Withdrawals cannot be made on an investment account.A check account can have a minimum balance of RO. The annual interest is 2% if the balance is greaterR20000. If the balance is greater than R100000 the annual interest can be 4%Each of the subclasses must have at least two constructors.The savings account, investment…arrow_forwardMUST BE IN JAVA In an n-sided regular polygon, all sides have the same length and all angles have the same degree (i.e., the polygon is both equilateral and equiangular). Design a class named RegularPolygon that contains: - A private int data field named n that defines the number of sides in the polygon with default value 3. - A private double data field named side that stores the length of the side with default value 1. - A private double data field named x that defines the x-coordinate of the polygon’s center with default value 0. - A private double data field named y that defines the y-coordinate of the polygon’s center with default value 0. - A no-arg constructor that creates a regular polygon with default values. - A constructor that creates a regular polygon with the specified number of sides and length of side, centered at (0, 0). - A constructor that creates a regular polygon with the specified number of sides, length of side, and x- and y-coordinates. - The accessor and…arrow_forwardWhen you want to work with an object, you use a variable that holds a special value known as a(n) __________ to link the variable to the object. a. union b. reference c. object linker d. data couplingarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author: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
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Memory Management Tutorial in Java | Java Stack vs Heap | Java Training | Edureka; Author: edureka!;https://www.youtube.com/watch?v=fM8yj93X80s;License: Standard YouTube License, CC-BY