Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 9, Problem 10RQ
Assume that you have created a class named TermPaper that contains a character field named letterGrade. You also have created a property for the field. Which of the following cannot be true?
- The property name is letterCrade.
- The property is read-only.
- The property contains a set accessor that does not allow a grade lower than 'C '.
- The property does not contain a get accessor.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
I have 4 class. The first one is Customer Class and in this class there is a method nameProvide() that if id length less than 10 it throws exception. There is a field named name(str). The other class is Board Class. There are fields such as points(double), win (boolean). The third class is BoardProvide Class.A method pointProvide() that if points less than 100 it throws exception . And the last class is Total Class. In total class there are a field named boardProvide type of BoardProvide and a field ArrayList<Board>boards. I need a write a method that;
1) Firstly, must be provide name validity in the method if name is not valid it throws exception. if name pass then, need to create a Board. After creating Board, boardProvide must be check that whether points is acceptiple or not. Add boards list(with finally block). If it is greater than 100, set win to True. If its not, catch exception, set False and return. JAVA
which of the following access modifier can be used if you want the member to be accessible to all external code?
Protected
any access modifier
public
private
default
Which of the following statements are true?
options:
Every class has a copy constructor with the signature ClassName(const ClassName&).
The copy constructor can be used to create an object initialized with another object's data.
By default, the copy constructor simply copies each data field in one object to its counterpart in the other object.
By default, the copy constructor performs a shallow copy.
Chapter 9 Solutions
Microsoft Visual C#
Ch. 9 - Assume that you have created a class named...Ch. 9 - Prob. 9RQCh. 9 - Assume that you have created a class named...Ch. 9 - Create an application named SalesTransactionDemo...Ch. 9 - Create an application named CarDemo that declares...Ch. 9 - Create a program named SalesTaxDemo that declares...Ch. 9 - Prob. 8ECh. 9 - Write a program named DemoJobs for Harolds Home...Ch. 9 - a. Write a FractionDemo program that instantiates...Ch. 9 - Prob. 1DE
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
- Which of the following statements is false? a. A class can contain only one constructor. b. An example of a behavior is the SetTime method in a Time class. c. An object created from a class is referred to as an instance of the class. d. An instance of a class is considered an object.arrow_forwardWhich of the statements regarding the super keyword is incorrect? (not correct) You can use super to invoke a super class constructor. You can use super to invoke a super class method. You can use super to access a field in the super class if it is protected. You can use super to access a field in the super class if it is private.arrow_forwardThis is the question - Create a class named Apartment that holds an apartment number, number of bedrooms, number of baths, and rent amount. Create a constructor that accepts values for each data field. Also create a get method for each field. Write an application that creates at least five Apartment objects. Then prompt a user to enter a minimum number of bedrooms required, a minimum number of baths required, and a maximum rent the user is willing to pay. Display data for all the Apartment objects that meet the user’s criteria or No apartments met your criteria if no such apartments are available. This is the code it has given and I have done some on- public class Apartment { int aptNumber; int bedrooms; double baths; double rent; public Apartment(int num, int bdrms, double bths, double rent) { } public int getAptNumber() { return aptNumber; } public int getBedrooms() { retrun bedrooms; } public double getBaths() {…arrow_forward
- This is the question - Create a class named Apartment that holds an apartment number, number of bedrooms, number of baths, and rent amount. Create a constructor that accepts values for each data field. Also create a get method for each field. Write an application that creates at least five Apartment objects. Then prompt a user to enter a minimum number of bedrooms required, a minimum number of baths required, and a maximum rent the user is willing to pay. Display data for all the Apartment objects that meet the user’s criteria or No apartments met your criteria if no such apartments are available. This is the code I already have. It doesn't seem to like under TestApartments my apt. variable. I am unsure what to do to fix this cause it doesn't like any of my code - public class Apartment { int aptNumber; int bedrooms; double baths; double rent; public Apartment(int num, int bdrms, double bths, double rent) { //write code here aptNumber = num;…arrow_forwardCreate an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and their sum. The SalesTransaction class contains the following fields: Name - The salesperson's name (as a string) salesAmount - 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() accessor method that returns the RATE Include three 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 0. An overloaded + operatoradds the sales values for two SalesTransaction objects and returns a new SalesTransaction object. In order to prepend the $ to…arrow_forwardWhich of the following is the name of the Inventory class’s default constructor? Inventory InventoryConstructor Default Newarrow_forward
- Which of the following is the member access operator in which you can find the methods inside the Class or Object.a. + b. .c. -d. ->arrow_forwardCreate a class named Person that holds the following fields: two String objectsfor the person’s first and last name and a LocalDate object for the person’sbirthdate. Create a class named Couple that contains two Person objects. Create aclass named Wedding for a wedding planner that includes the date of the wedding,the names of the Couple being married, and a String for the location. Provideconstructors for each class that accept parameters for each field, and provide getmethods for each field. Then write a program that creates two Wedding objectsand in turn passes each to a method that displays all the details. Save the files asPerson.java, Couple.java, Wedding.java, and TestWedding.java.arrow_forwardWhere may the object's supertype be found inside its storage?arrow_forward
- Recall the SpecificBox. When testing your class, what is theminimum number of test cases that should be used? Provide these (minimum number of) testcases in a text file called tests.txt. Each test case in the file should have the following format(for example, if this is your 3rd test)// Test 3// TESTING - testing XYZbox1 = new SpecificBox(label1, location1, size1);box2 = new SpecificBox(label2, location2, size2);expected = exp; // an integeractual = box1.comppareTo(box2);Here, label1, label2, location1, location2, size1, size2, and exp are values you supply. TheTESTING comment should provide a brief description of what is being tested. Note that pastingany of your test cases in to the following code should work:SpecificBox box1, box2;int expected, actual;//// your test copied here//System.out.println("test passed : " + (expected == actual);At the end of your tests.txt file, briefly explain what you need these number of tests.arrow_forwardCreate a class named Apartment that holds an apartment number, number of bedrooms, number of baths, and rent amount. Create a constructor that accepts values for each data field. Also create a get method for each field. Write an application that creates at least five Apartment objects. Then prompt a user to enter a minimum number of bedrooms required, a minimum number of baths required, and a maximum rent that the user is willing to pay. Display data for all the Apartment objects that meet the user’s criteria or an appropriate message if no such apartments are available.arrow_forwardHow can I solve this problem? Write an application named UseCourse that prompts the user for course information. If the user enters a class in any of the following departments, create a LabCourse object: BIO, CHM, CIS, or PHY. If the user enters any other department, create a CollegeCourse that does not include the lab fee. Then display the course data.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY