All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Ask a Question
Search
Search
Sign In
Register
study help
computer science
programming logic & design
Questions and Answers of
Programming Logic & Design
Which of the following is not a similarity between constructors and destructors?a. Both can be called automatically.b. Both can be overloaded.c. Both have the same name as their class.d. Both
Most often, a destructor is called when _________.a. An explicit call is made to itb. An object is instantiatedc. An object goes out of scoped. A value is returned from a class method
When you write a constructor that receives no parameters, _________.a. The automatically-created constructor no longer existsb. It becomes known as the default constructorc. Both of the aboved. None
When you write a constructor that receives a parameter, _________.a. The automatically-created default constructor no longer existsb. The parameter must be used to set a data fieldc. It becomes the
Every default constructor _________.a. Requires no parameterb. Sets a default value for every field in a classc. Is created automaticallyd. Is the only constructor that is explicitly written in a
Which of the following can be overloaded?a. Constructorsb. Instance methodsc. Both of the aboved. None of the above
Every class has _________.a. Exactly one constructorb. At least one constructorc. At least two constructorsd. A default constructor and a programmer-written constructor
When you instantiate an object, the automatically created method that is called is a(n) ____________.a. Creatorb. Initiatorc. Constructord. Architect
Your downloadable files for Chapter 10 include a file named DEBUG10-04.jpg that contains a class diagram with syntax and/or logical errors. Examine the class diagram, and then find and correct all
Your downloadable student files for Chapter 10 include DEBUG10-01.txt, DEBUG10-02.txt, and DEBUG10-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin
A file named MAINTENANCE10-01.txt is included with your downloadable student files. Assume that this program is a working program in your organization and that it needs modifications as described in
Complete the following tasks:a. Design a class named BaseballGame that has fields for two team names and a final score for each team. Include methods to set and get the values for each data field.
Complete the following tasks:a. Design a class named Cake. Data fields include two string fields for cake flavor and icing flavor and numeric fields for diameter in inches and price. Include methods
Complete the following tasks:a. Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, and price per share. Include methods to set and get the
Complete the following tasks:a. Design a class named AutomobileLoan that holds a loan number, make and model of automobile, and balance. Include methods to set values for each data field and a method
Design a class named Computer that holds the make, model, and amount of memory of a computer. Include methods to set the values for each data field, and include a method that displays all the values
Design a class named TermPaper that holds an author’s name, the subject of the paper, and an assigned letter grade. Include methods to set the values for each data field and display the values for
Identify three different classes that might contain each of these objects:a. myBlueDenimShirtb. presidentOfTheUnitedStatesc. myPetCatd. myCousinLindsey
Identify three objects that might belong to each of the following classes:a. Authorb. RaceHorsec. Countryd. RetailPurchase
An object can be ________.a. Stored in an arrayb. Passed to a methodc. Returned from a methodd. All of the above
Assume that you have created a class that contains a private field named myField and a nonstatic public method named myMethod(). Which of the following is true?a. myMethod() has access to myField and
Assume that you have created an object named myObject and that a working program contains the following statement:output myObject.getSize()Which of the following do you know?a. getSize() is a static
Assume that you have created a class named MyClass, and that a working program contains the following statement:output MyClass.numberOfStudentsWhich of the following do you know?a. numberOfStudents
By default, methods contained in a class are ________methods.a. Staticb. Nonstaticc. Classd. Public
A static method is also known as a(n) ________ method.a. Instanceb. Classc. Privated. Public
Assume that you have created a class named Dog that contains a data field named weight and an instance method named setWeight(). Further assume that the setWeight() method accepts a numeric parameter
An instance method ________.a. Is staticb. Receives a this referencec. Both of the aboved. None of the above
Which of the following is the most likely scenario for a specific class?a. Its data is private and its methods are public.b. Its data is public and its methods are private.c. Its data and methods are
A class diagram ________.a. Provides an overview of a class’s data and methodsb. Provides method implementation detailsc. Is never used by nonprogrammers because it is too technicald. All of the
Assume that a working program contains the following statement:name = myDog.getName()Which of the following do you know?a. getName() returns a string.b. getName() returns a value that is the same
Assume that a working program contains the following statement: myDog.setName("Bowser")Which of the following do you know?a. setName() is a public method.b. setName() accepts a string parameter.c.
Every class definition must contain ________.a. A nameb. Datac. Methodsd. All of the above
When discussing classes and objects, encapsulation means that ________.a. All the fields belong to the same objectb. All the fields are privatec. All the fields and methods are grouped togetherd. All
The process of acquiring the traits of one’s predecessors is ________.a. Polymorphismb. Encapsulationc. Inheritanced. Orientation
Which of these does not belong with the others?a. Instance variableb. Attributec. Objectd. Field
The relationship between an instance and a class is a(n) ________ relationship.a. Has-ab. Hostilec. Polymorphicd. Is-a
A program that instantiates objects of another prewritten class is a(n) ________.a. Instanceb. Objectc. Clientd. GUI
Which of the following means the same as instance variable?a. Classb. Fieldc. Categoryd. Record
Which of the following means the same as object?a. Instanceb. Classc. Fieldd. Category
In the Game Zone section of Chapter 6, you designed the logic for the game Hangman, in which the user guesses letters in a hidden word. Improve the game to store an array of 10 words. One at a time,
In the Game Zone sections of Chapters 6 and 8, you designed the logic for a quiz that contains questions about a topic of your choice. Now, modify the program so it contains an array of five
Your downloadable files for Chapter 9 include a file named DEBUG09-04.jpg that contains a flowchart with syntax and/or logical errors. Examine the flowchart, and then find and correct all the bugs.
Your downloadable files for Chapter 9 include DEBUG09-01.txt, DEBUG09-02.txt, and DEBUG09-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin with two
A file named MAINTENANCE09-01.txt is included with your downloadable student files. Assume that this program is a working program in your organization and that it needs modifications as described in
Each of the programs in Figure 9-25 uses a recursive method. Try to determine the output in each case. a. b. c. start start start output recursiveA(0) stop num recursiveA(num x) num result if x = 0
Create the logic for a program that prompts a user for 20 numbers and stores them in an array. Pass the array to a method that calculates the arithmetic average of the numbers and returns the value
Create the logic for a program that prompts a user for 12 numbers and stores them in an array. Pass the array to a method that reverses the order of the numbers. Display the reversed numbers in the
Create the logic for a program that computes hotel guest rates at Cornwall’s Country Inn. Include two overloaded methods named computeRate(). One version accepts a number of days and calculates the
Create the logic for a program that prompts the user for numeric values for a month, day, and year. Then pass the three variables to the following methods:a. A method that displays the date with
a. Plan the logic for an insurance company program to determine policy premiums. The program continuously prompts the user for an insurance policy number. When the user enters an appropriate sentinel
Create the logic for a program that calls a method that computes and returns a homeowner’s profit from the home’s sale. Arguments passed to the method include the sale price and the following
Create the logic for a program that continuously prompts a user for a numeric value until the user enters 0. The application passes the value in turn to the following methods:A method that displays
a. Create the logic for a program that performs arithmetic functions. Design the program to contain two numeric variables, and prompt the user for values for the variables. Pass both variables to
Create the logic for a program that accepts a user’s birth month and year and passes them to a method that calculates the user’s age in the current month and returns the value to the main program
a. Create the logic for a program that calculates and displays the amount of money you would have if you invested $5000 at 2 percent simple interest for one year. Create a separate method to do the
Create an IPO chart for each of the following methods:a. The method that calculates the amount owed on a restaurant check, including tipb. The method that calculates the cost to drive your car a
Programmers should strive to _____.a. Increase couplingb. Increase cohesionc. Both of the aboved. Neither a nor b
The notion of _____ most closely describes the way a calling method is not aware of the statements within a called method.a. Abstractionb. Object-orientedc. Implementation hidingd. Encapsulation
Methods in different programs with identical names and identical parameter lists are _____.a. Overloadedb. Illegalc. Both of the aboved. None of the above
Methods in the same program with identical names and identical parameter lists are _____.a. Overloadedb. Overworkedc. Overwhelmedd. Ambiguous
A program contains a method with the header num calculateTaxes(num amount, string name). Which of the following methods can coexist in the same program with no possible ambiguity?a. Num
When you overload a method, you write multiple methods with the same_____.a. Nameb. Parameter listc. Number of parametersd. Return type
When an array is passed to a method, it is _____.a. Passed by referenceb. Passed by valuec. Unnamed in the methodd. Unalterable in the method
A void method _____.a. Contains no statementsb. Requires no parametersc. Returns nothingd. Has no name
When a method receives a copy of the value stored in an argument used in the method call, it means the variable was _____.a. Unnamedb. Passed by valuec. Passed by referenced. Assigned its original
The value used in a method’s return statement must _____.a. Be numericb. Be a variablec. Match the data type used before the method name in the headerd. Two of the above
Assume you have written a method with the header string myMethod(num score, string grade). Also assume you have declared a numeric variable named test. Which of the following is a correct method
Assume you have written a method with the header num yourMethod(string name, num code). The method’s type is _____.a. Numb. Stringc. Num and stringd. Void
Assume you have written a method with the header void myMethod(num a, string b). Which of the following is a correct method call?a. MyMethod(12)b. MyMethod("Goodbye")c. MyMethod(12, "Hello")d. It is
When you use a variable name in a method call, it _____ as the variable in the method header.a. Can have the same nameb. Cannot have the same namec. Must have the same named. Cannot have the same
When you write the declaration for a method that can receive a parameter, which of the following must be included in the method declaration?a. The name of the argument that will be used to call the
A method’s interface is its _____.a. Parameter listb. Return typec. Identifierd. All of the above
Although the terms parameter and argument are closely related, the difference is that argument refers to _____.a. A value in a method callb. A passed constantc. A formal parameterd. A variable that
Which of the following is most closely related to the concept of local?a. In scopeb. Object-orientedc. Program leveld. Abstract
Which of the following must every method have?a. A parameter listb. A headerc. A return valued. All of the above
Which of the following is true?a. A program can call one method at most.b. A method can contain one or more other methods.c. A program can contain a method that calls another method.d. All of
In the Game Zone section of Chapter 5, you designed a guessing game in which the application generates a random number and the player tries to guess it. After each guess, you displayed a message
In the Game Zone section of Chapter 6, you designed the logic for a quiz that contains multiple-choice questions about a topic of your choice. (Each question had three answer options.) Now, modify
Your downloadable files for Chapter 8 include a file named DEBUG08-04.jpg that contains a flowchart with syntax and/or logical errors. Examine the flowchart, and then find and correct all the bugs.
Your downloadable files for Chapter 8 include DEBUG08-01.txt, DEBUG08-02.txt, and DEBUG08-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin with two
A file named MAINTENANCE08-01.txt is included with your downloadable student files. Assume that this program is a working program in your organization and that it needs modifications as described in
HappyTunes is an application for downloading music files. Each time a file is purchased, a transaction record is created that includes the music genre and price paid. The available genres are
Executive Training School offers typing classes. Each final exam evaluates a student’s typing speed and the number of typing errors made. Develop the logic for a program that produces a summary
Building Block Day Care Center charges varying weekly rates depending on the age of the child and the number of days per week the child attends, as shown in Table 8-5. Develop the logic for a program
Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 pm, 7 pm, or 9pm. Design a program that accepts reservations for specific tables at specific times; the user enters the number of
a. The Daily Trumpet newspaper accepts classified advertisements in 15 categories such as Apartments for Rent and Pets for Sale. Develop the logic for a program that accepts classified advertising
a. Three Strikes Bowling Lanes hosts an annual tournament for 12 teams. Design a program that accepts each team’s name and total score for the tournament and stores them in parallel arrays. Display
The village of Marengo conducted a census and collected records that contain household data, including the number of occupants in each household. The exact number of household records has not yet
Girl Scout Troop 815 has 18 members. Write a program in which the troop leader can enter the number of boxes of cookies sold by each scout, and output the total number of boxes sold and the mean and
a. Professor Zak allows students to drop the four lowest scores on the ten 100-point quizzes she gives during the semester. Design an application that accepts a student name and 10 quiz scores.
Design an application that accepts 15 words and displays them in alphabetical order.
Design an application that accepts 10 numbers and displays them in descending order.
With a linked list, every record _____.a. Is stored in sequential orderb. Contains a field that holds the address of another recordc. Contains a code that indicates the record’s position in an
When a record in an indexed file is not needed for further processing, _____.a. Its first character must be replaced with a special character, indicating it is a deleted recordb. Its position must be
When you store a list of key fields paired with the storage address for the corresponding data record, you are creating _____.a. A directoryb. A three-dimensional arrayc. A linked listd. An index
Student records are stored in ID number order, but accessed by grade point average for a report. Grade point average order is a(n) _____ order.a. Imaginaryb. Physicalc. Logicald. Illogical
Three-dimensional arrays _____.a. Are supported in many modern programming languagesb. Always contain at least nine elementsc. Are used only in object-oriented languagesd. All of the above
If you access a two-dimensional array with the expression output myArray[2][5], the output value will be _____.a. 0b. 2c. 5d. Impossible to tell from the information given
In a two-dimensional array declared as num myArray[6][7], the highest row number is ______.a. 5b. 6c. 7d. 8
A two-dimensional array declared as num myArray[6][7] has _____ columns.a. 5b. 6c. 7d. 8
Showing 100 - 200
of 459
1
2
3
4
5