Science question

Assignment Help Basic Computer Science
Reference no: EM13762262

Question 1.1.Only those class members that are presented to the users of the class are part of the ______ of the class.

interface

implementation

constructors

superclass

Question 2.2.A private attribute can have an associated public _____ to allow an outside class to retrieve its value.

constructor

destructor

getter

mutator

Question 3.3. Which of the following statements is/are false?

A change to the implementation should not require a change to the user's code.

If you declare an attribute as private, you do not have to worry about tracking down every piece of code that might have changed the attribute when debugging.

When interacting with the interface of an object, you need to know what the code looks like inside the methods, which comprise the interface.

All of the above

None of the above

Question 4.4. A Waiter is responsible for taking the order from the Customer based on the menu, informing the Chef of the order and delivering the requested food back to the Customer. A Chef is responsible for preparing the food and notifying the Waiter when the food is ready. The Customer is responsible for placing an order from the menu. In identifying the interface of the Waiter object, which of the following would you consider as (an) appropriate message(s) the Waiter should respond to?

"Please bring me chicken soup."

"Can you tell me how to make macaroni and cheese?"

"How many hours do you work?"

All of the above

Only A and B

Question 5.5.The purpose of a(n) _____ is to initialize the object's data members when an object is instantiated.

methods

constructor

class

destructor

Question 6.6.Which of the following method pairs are not examples of method overloading?

public void Mark() ; public int Move(int x)

public int Cook(int x) ; public void Cook(int x, double y)

public int Add(int x) ; public int Add(int y)

All of the above

Only A and C

Question 7.7.Consider the following class definition.

class Flower

{

private:

string color;

double cost;

public:

Flower()

{

color = "red";

cost = 0.0;

}

Flower(string c)

{

color = c;

cost = 0.0;

}

void setColor(string c)

{

color = c;

}

void setCost(int amount)

{

cost = amount;

}

}

Which of the following is/are true?

(i) The attribute cost can be set to a new value, by a user

of this class

(ii) You can write cout<<"The flower is: " << Flower.setColor();

(iii) A default constructor is provided.

Only i and iii

None are true

All are true

Question 8.8.Assume a class has a method called ‘ComputeAverage()'. Can another class have a method called ‘ComputeAverage()' ?

Yes, as long as the method performs the same or similar task.

Yes, this is possible.

No, because the compiler cannot distinguish the appropriate method to call.

None of the above

Question 9.9. Which of the following statements is/are true?

Most object-oriented languages provide a feature called exceptions.

One error handling strategy is to check for problems and attempt to recover.

In a try/catch block, if an exception is thrown within the try block, the catch block will handle it.

All of the above

Question 10.10. Assume a class contains one non-static data member and two static data members. If two objects have been instantiated from the class, how many copies of the static data member exist?

3

1

4

2

Reference no: EM13762262

Questions Cloud

Monitoring our home planet : The Internet is a powerful tool that provides the ability to monitor natural phenomena and disasters that happen all over planet Earth.
Packet-switched and circuit-switched : Packet-switched and circuit-switched are two standards utilized by wide area networks. In your Discussion Board posting of 4-6 paragraphs, address the following:
Converting from fahrenheit to celsius : Converting from Fahrenheit to Celsius, Create a Memo using the Memo Template for each of the tasks. The document should contain
Appropriate basis of overhead application : What would be the more appropriate basis of overhead application: printing press machine hours or direct labor hours? Given the choice of driver, are there any implications to consider for under or over applied overhead?
Science question : Only those class members that are presented to the users of the class are part of the ______ of the class.
Discuss the elements of your own poem : Discuss the elements of your own poem. Consider elements such as persona, image, meter, rhythm, rhyme, metaphor, symbol, allegory, mood, and voice.
Direct and indirect presentation of cash flows : Write a 350-word response regarding the differences between the direct and indirect presentation of cash flows. Why does the Financial Accounting Standards Board allow both methods? Which do you prefer? Why?
What would be the costs of each action : What 1 policy could you use to reduce the total amount of emissions and why do you think the policy would reduce the total amount of emissions?
Information triage is the process of : Information triage is the process of sorting through information you have gathered to determine what is most useful

Reviews

Write a Review

Basic Computer Science Questions & Answers

  List at least five different pieces of hardware

(1) Identify the hardware you have on your computer and catagorize each piece as input, output, or both. (2) List at least five different pieces of hardware with at least one of each category.

  Calculate and display running total of yesterday receipts

calculate and display the running total of yesterday's receipts. The program should use the method calculate-Charges to determine the charge for each customer.

  Executing critical section in mutual exclusion protocol

In Lamport's mutual exclusion protocol, if process i is implementing critical section.

  Research and discuss applications in a specific device

Discuss further thoughts on the importance of path finding to devices like GPSs. Conduct some research and discuss applications in a specific device

  Write in hexadecimal representation

what instructions do they represent - Suppose both signed and unsigned cases. Write them in hexadecimal representation.

  Many-to-many relationship

What are some issues when working with a many-to-many relationship? Provide some examples.

  Represent 99 and -99 in 2s complement format

what are the largest(positive) and smallest (negative) integers a word can represent - Represent 99 and -99 in 2's complement format.

  Design and implement a java program

Design and implement a Java program that will read a file containing numbers and compute the following statistics: the range (low, high), the average and the median (middle number).

  Define a class called blogentry

Define a class called BlogEntry that could be used to store an entry for a Web log. The class should have instance variables to store the poster's username, text of the entry, and the date of the entry using the Date class.

  One from manufacturing

One from manufacturing and the other from a service industry

  Passing an "in out" parameter to a procedure

In Ada, when passing an "in out" parameter to a procedure, the system is allowed to use either pass-by-reference or pass-by-value-result as it sees fit. Why?

  Application be connectionless or connection oriented

Your company is creating a new network application that allows employees to view their pay checks subs electronically via the Internet. Should this application be connectionless or connection oriented?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd