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
marissa [1.9K]
4 years ago
11

What is output when the CarTest application is run? Why?

Computers and Technology
1 answer:
erik [133]4 years ago
5 0

Answer:

red

Explanation:

public class CarTest {

public static void main(String[] argvs) {

//below line will create an object of CarTest class Object

CarTest carTest = new CarTest();

//This will call runDemo method

carTest.runDemo();

}

public void runDemo() {

//Below line will create an object of Car class  with color blue and 4 wheel

Car c = new Car("blue", 4);

//Bellow Line will change the color from blue to red, see the logic writteen in chnageColor method definition

changeColor(c, "red");

//Below line will print the color as red

System.out.println(c.getColor());

}

public void changeColor(Car car, String newColor) {

//This line will set the color as passed color in the car object

car.setColor(newColor);

}

}

You might be interested in
What is the best file manager for windows 10?
SOVA2 [1]

In my opinion, XYplorer is the best

7 0
3 years ago
Read 2 more answers
If a webpage utilizes two css files - style.css and media-queries.css, which should be linked last in the head section?
Dmitry_Shevchenko [17]
Media-queries.css should be linked last, the same as if your media queries were in the same file (always go last)
4 0
3 years ago
True or false you have no control over who views your social network information
cestrela7 [59]
<span>This statement is false. Privacy is a very high-stakes concern for many social networks, who have gone to great lengths to put in place certain restrictions, such as the ability to make ones profile private or hide a profile from certain individuals.</span>
4 0
3 years ago
Lines, block arrows, stars, and banners are examples of which of the following
bija089 [108]

Answer:

Lines, block arrows, stars and banners are examples of which of the following is smart art graphic

7 0
3 years ago
21. Dice Game Write a program that plays a simple dice game between the computer and the user. When the program runs, a loop sho
Brrunno [24]

Answer:

See Explanation Below

Explanation:

// Program is written in C++ programming language

//.. Comments are used for explanatory purposes

// Program starts here

#include<iostream>

#include <stdlib.h>

#include <time.h>

using namespace std;

int main()

{

int computerWins = 0, computerPlay = 0;

int userWins = 0, userPlay = 0;

int tiedGames = 0;

// Computer Play

for (int play = 0; play< 10; play++) {

   computerPlay = rolls();

   userPlay = rolls();  

   // Check who wins

//Clear Screen

System("CLS")

   if (computerPlay == userPlay) {

       tiedGames++;

cout<<"Ties........" + tiedGames;    }

else {

       if (computerPlay> userPlay) {

           computerWins++;

cout<<"Computer...."<< computerWins;

       } else {

           userWins++;

cout<<"User........"<< userWins;

      }

  }

}

return 0;

}

int rolls() {

srand((unsigned)time(0));

return rand() % 6 + 1;

}

5 0
3 years ago
Other questions:
  • The user documents are stored in _______ format.
    15·1 answer
  • Find the greatest common factor of 48 and 36.​
    6·1 answer
  • If two hosts are connected by five networks, how many frames will there be when one host sends a packet to the other host? 1 2 5
    13·1 answer
  • This isn't a homework question but rather a technological problem. I connected my device to the motherboard but it will not dete
    5·2 answers
  • What should you do if a reporter asks you about potentially classified information on the web
    12·1 answer
  • A TCP ________ segment is a request to the other transport process to close a connection. ACK FIN SYN CLS
    15·1 answer
  • Help with this quiz question thank you!
    12·2 answers
  • Implement the function printTwoLargest that inputs an arbitrary number of positive numbers from the user. The input of numbers s
    14·1 answer
  • Write a program that inputs numbers and keeps a running sum. When the sum is greater than 100, output the sum as well as the cou
    8·1 answer
  • Explain the different type of shift register counter ​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!