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
hammer [34]
3 years ago
10

Public class SomeClass { private String aName; private int aNumber; private boolean amAwesome; public SomeClass(String name, int

number){ aName = name; aNumber = number; amAwesome = true; } public SomeClass(String name, int number, boolean awesome){ aName = name; aNumber = number; amAwesome = awesome; } public void methodAwesome(int number){ if(amAwesome) aNumber += number - 5; amAwesome = !amAwesome; } public int method Fantastic(boolean fantastic){ fantastic = fantastic && amAwesome; if(!fantastic && aNumber > 0) aName = aName + " is fantastic"; return aNumber *= -2; } public void methodAmazing(int num){ if(aNumber < 0) aNumber = num; } public static void main(String[] args) { SomeClass awesome = new SomeClass("Awesome", 5); awesome.methodAmazing(10); int eNum = awesome.method Fantastic(true); SomeClass amazing = new SomeClass("Amazing", -10, false); amazing.methodAwesome(7); amazing.methodAmazing(18); SomeClass fantastic = new SomeClass ("Fantastic", 11, true); int fanNum = fantastic.methodFantastic(true); fantastic.methodAwesome(awNum + fanNum); } }
How many objects are created in the main method
Computers and Technology
1 answer:
scoray [572]3 years ago
3 0

Answer:

The objects created in the main method and their initial states are given below

Explanation:

The objects and initial state of each object( the values of each object’s variables) are thus:

We have objects awesome, amazing and fantastic.

initial state of awesome object is

aName = "Awesome"; aNumber = 5; amAwesome = true;

initial state of amazing object is

aName = "Amazing"; aNumber = -10; amAwesome = false;

initial state of fantastic object is

aName = "Fantastic"; aNumber = 11; amAwesome = true

You might be interested in
____ are model building techniques where computers examine many potential solutions to a problem, iteratively modifying various
gregori [183]

Answer:

E. Genetic algorithms

Explanation:

In Computer science, Genetic algorithms are model building techniques where computers examine many potential solutions to a problem, iteratively modifying various mathematical models, and comparing the mutated models to search for a best alternative.

6 0
3 years ago
Q4. What is one of the benefits of using a library in a program?
Grace [21]

Answer:

Simplifies creating a complex program

Explanation:

5 0
3 years ago
The following pseudocode describes how a bookstore computes the price of an order from the total price and the number of the boo
ICE Princess25 [194]

Answer:

float bookExamplePrice = 15.25;

float bookTax = 7.5;

float bookShippingPrice = 2.0;

float Test = bookExamplePrice / 100;

float Tax = Test * bookTax;

float FullPrice = Tax + bookExamplePrice + bookShippingPrice;

// I don't know how to remove the numbers after the first two decimals.

// I tested this program. It works!

// The text after the two slashes don't run when you compile them.

printf("Price: $%.6f\n",FullPrice);

Explanation:

8 0
3 years ago
I lost my account!-_-​
exis [7]

Answer:

and?

Explanation:

thx for the points btw

7 0
3 years ago
A _____________ is a situation in which a hacker attempts to disrupt the network by sending messages to the network that prevent
LUCKY_DIMON [66]
I think its a virus or a trojan horse
8 0
3 years ago
Other questions:
  • What is tuple and attribute of a relation​
    11·1 answer
  • List the general steps that are used to configure a soho router and set up the network
    13·1 answer
  • The ________ utility automatically creates duplicates of your libraries, desktops, contacts, and favorites to another storage lo
    7·1 answer
  • Taken together, the physical and data link layers are called the ____________________. Internet layer Hardware layer Internetwor
    15·1 answer
  • Which of the following is the component of the processor that directs and coordinates most of the operations in the computer?A.
    12·1 answer
  • Jeremy is designing a website for a florist. He intends to discuss the web design with his client. Which tool should Jeremy use
    6·1 answer
  • There are two main advantages to using multiple threads in a process: 1) Less work involved in creating a new thread rather than
    7·1 answer
  • To maintain your body temperature, your body converts chemical potential energy into thermal energy T or F
    6·1 answer
  • Which of the following is an example of phishing attack? csp
    8·1 answer
  • Which of the following electronic collaboration techniques is the best
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!