1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sasho [114]
4 years ago
13

Here is a Test Code segment:

Computers and Technology
1 answer:
Tju [1.3M]4 years ago
3 0
Here's the best answer I can give you, but bear with me.
The second option is incorrect because a class method must have a class identifier not an object identifier. What makes myObject an object identifier is the fact that it was created as an instance of the class MyClass in the constructor in line 5 (MyClass myObject= new MyClass(12.4,20);
The answer here should be MyClass.method2(20); Methods must have a set of parentheses, even if it has nothing inside. The first answer has a class identifier but the SOME_VALUE acts much like the Integer.MAX_VALUE; code which stores a constant value and does not actually perform tasks like most methods.
In short, the answer should be the last one but I hope my explanation cleared some things up for you, even if it was a bit more concept heavy than the question probably intended.
You might be interested in
Provide examples of the cost of quality based on your own experiences
Phoenix [80]

Answer:

Cost of quality is define as methodology which basically decide the cost of product and services in an organisation and company. It also determine all the cost which are associated with the quality.

The cost of quality basically divided into four categories that are:

  • Appraisal
  • Prevention
  • External failure
  • Internal failure

Example of the cost of quality is that, in oil refinery industry if the growth of product increased then, the company state also increased. In same way, if there is decrease in the refining state of the product then, the growth of product automatically reduced.

3 0
3 years ago
"Margaret has $3,200 cash after selling off her television, DVD player, and computer. She has debts of $4,800 owing to the follo
serg [7]

Answer: Hyatt's  will be able to collect $1,365

Explanation: Composition Agreement is a kind of agreement reached between a debtor and its creditors. it a kind of agreement whereby the debtor and creditors agree to collect a percentage of their debts to fully settle their debts from the creditor.

For instance Margaret with a cash of $3,200 to settle a debt of $4,800.

In this case Margaret can decide to pay 65% of the total debts to settle the final debts. Here, Hyatt's  will be able to collect $1,365 as full settle of his debt.

5 0
3 years ago
Create an application named TestClassifiedAd that instantiates and displays at least two ClassifiedAd objects. A ClassifiedAd ha
arlik [135]

Answer:

Following is given the code with all necessary descriptions as comments in it. The output is also attached under the code. I hope it will help you!

Explanation:

5 0
3 years ago
Write a program that simulates a lottery. The program should havean array of five integers named lottery, and shouldgenerate a r
Fiesta28 [93]

Answer:

Here is the C++ program that simulates lottery:

#include<iostream>  //to use input output functions

using namespace std;  //to access objects cin cout

int main(){  //start of main function

int size= 5; // size of arrays

int range = 10;  //range of random numbers from 0 to 9

int user[size];  // user array

int lottery[size];  // lottery array

for(int i=0;i<size;i++)  //iterates through the array

lottery[i]=rand()%range;  // generates random number in specified range

cout<<"Enter "<<size<<" digits: ";  //prompts user to enter 5 digits

for(int i=0;i<size;i++)  //loops through the user array

cin>>user[i];  //reads input digits from user

int match=0;  //stores number of matching digits

for(int i=0;i<size;i++)  //iterates through array to compare user and lottery arrays

if(user[i]==lottery[i])  //if digit at i-th index of user array matches to that of lottery array

match++;  //increments count of matching digits by 1

cout<<"Lottery array: ";  // display digits of lottery array

for(int i=0;i<size;i++)  //iterates through elements of lottery array

cout<<lottery[i]<<" ";  //prints elements of lottery array with a space between them

cout<<endl;  //prints a new line

cout<<"  User  array: ";  // prints digits of user array

for(int i=0;i<size;i++) //iterates through elements of user array

cout<<user[i]<<" ";  //prints elements of user array

cout<<endl;  // prints a new line

if(match==size){  //if all the digits match

cout<<"Congratulations. You are a grand prize winner! "; }//displays this message proclaiming the user as a grand prize winner

else{  // if all digits of user array do not match with lottery array digits

cout<<"Number of digits matched: "<<match<<endl; //displays the number of matched digits

cout<<"Sorry! Better luck next time!" ;    //displays this message when all digits don't match

}

}    

Explanation:

If you want to keep the size and range fixed then you can use #define before the main() function to give a constant value to size and range as:

#define size 5

#define range 10

The program uses rand() function in order to generate random numbers for lottery array in the range of 0 through 9.

Then the program declares a user array with size = 5 and prompts user to enter 5 digits to stores in user array.

Next the program matches each digit of user array to the corresponding digit of lottery array and if the two digits match then the program increments the match variable by 1 to count the matched digits. For example, lets say lottery has the following elements:

lottery: 7,4,9,1,3

Lets say user array has following elements input by user at console

user: 4,2,9,7,3

Now at first iteration the digit 7 at 0-th index of lottery array is matched to the digit 4 at 0-th index of user array. This index is specified using variable i. These means the first element of lottery array is matched with first element of user array. As these digits are not equal so they don't match and the variable i is incremented to point to the position of next digit.

Now at second iteration the digit 4 in lottery array is matched to the digit 2 of user array. As these digits are not equal so they don't match and the variable i is incremented.

at third iteration the digit 9 in lottery array is matched to the digit 9 of user array. As these digits equal so they match and the variable match is incremented to 1 in order to count the number of matches. So value of match = 1

Now at fourth iteration the digit 1 in lottery array is matched to the digit 7 of user array. As these digits are not equal so they don't match and the variable i is incremented. The value of match also remains the same i.e. 1

at fifth iteration the digit 3 in lottery array is matched to the digit 3 of user array. As these digits equal so they match and the variable match is incremented to 1 in order to count the number of matches. So value of match = 2

Next the loop ends because the value of exceeds 5 which is the size of the array.

Next if(match==size) statement has an if condition which checks if all digits match. This is checked by comparing the count of match variable to the size of the array. The value of match is 2 and value of size is 5 so this means that all the digits do not match. Hence this condition evaluates to false. So the statement in if part will not execute and program moves to the statement: cout<<"Number of digits matched: "<<match<<endl; which displays the value of match variable i.e. 2 as:

Number of digits matched: 2

followed by statement cout<<"Sorry! Better luck next time!" ;  which displays the message:

Sorry! Better luck next time!

5 0
3 years ago
Small-business owner Marcos set up his Google Ads campaign by thinking of “obvious” keywords off of the top of his head. What's
LiRa [457]

Answer:See the suggestions on the Opportunities tab

Explanation: The improvement in the Google ad can be made by the taking a look at the Opportunities tab which will display the adequate opportunities.

The tab displays these opportunities on the basis of the campaign settings, account's history, performance, style, trends etc and thus will create the appropriate opportunities accordingly.Thus Marcos will have to see the suggestion displayed on Opportunities tab

5 0
3 years ago
Other questions:
  • A __________ network is good for connecting computer clusters.
    13·2 answers
  • Annabeth has been using a public cloud to store and access her documents. Which drawback of a public cloud should she be aware o
    11·1 answer
  • Required
    12·1 answer
  • Question 12 (1 point)
    6·1 answer
  • What observations can you make about any of these data structures ? Go into as much as you can. Try proposing your own data stru
    8·1 answer
  • Which of the following controls will provide an area in the form for the user to enter a name? a. button b. label c. text box d.
    8·1 answer
  • 20. Modifying a report is easiest from what view. O A. Report O B. Layout O C. Print O D. Design
    14·1 answer
  • What are 3 tools you would use to make the spreadsheet look nicer? Explain what
    9·1 answer
  • Ismael is examining a report in Access. He needs to access a view that will be used to examine and change the structure of the r
    9·2 answers
  • Who is the monst important person and why
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!