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
vlabodo [156]
3 years ago
10

For this exercise, you are going to complete the printScope() method in the Scope class. Then you will create a Scope object in

the ScopeTester and call the printScope.
The method will print the name of each variable in the Scope class, as well as its corresponding value. There are 5 total variables in the Scope class, some of which can be accessed directly as instance variable, others of which need to be accessed via their getter methods.
For any variable that can be accessed directly, use the variable name. Otherwise, use the getter method.
Sample Output:
The output of the printScope method should look like this:
a = 5
b = 10
c = 15
d = 20
e = 25
public class ScopeTester
{
public static void main(String[] args)
{
// Start here!
}
}
public class Scope
{
private int a;
private int b;
private int c;
public Scope(){
a = 5;
b = 10;
c = 15;
}
public void printScope(){
//Start here
}
public int getA() {
return a;
}
public int getB() {
return b;
}
public int getC() {
return c;
}
public int getD(){
int d = a + c;
return d;
}
public int getE() {
int e = b + c;
return e;
}
}
Computers and Technology
1 answer:
iragen [17]3 years ago
4 0

Answer:

Explanation:

The following is the entire running Java code for the requested program with the requested changes. This code runs perfectly without errors and outputs the exact Sample Output that is in the question...

public class ScopeTester

{

public static void main(String[] args)

{

       Scope scope = new Scope();

       scope.printScope();

}

}

public class Scope

{

private int a;

private int b;

private int c;

public Scope(){

a = 5;

b = 10;

c = 15;

}

public void printScope(){

       System.out.println("a = " + a);

       System.out.println("b = " + b);

       System.out.println("c = " + c);

       System.out.println("d = " + getD());

       System.out.println("e = " + getE());

}

public int getA() {

return a;

}

public int getB() {

return b;

}

public int getC() {

return c;

}

public int getD(){

int d = a + c;

return d;

}

public int getE() {

int e = b + c;

return e;

}

}

You might be interested in
. When a system isdelivered over time, with each delivery (release) adding tothe
dexar [7]

Answer:

A. Incremental Development

Explanation:

Great question, it is always good to ask away and get rid of any doubts that you may be having.

The answer to this question is Incremental Development, this is when the development of the system is implemented little by little as time goes on. On the other hand phase development is when a development cycle is rolled out in phases such as the brainstorming phase, Construction phase, marketing , and roll out phase. Since this development doesn't contribute to the system's functionality it is not the correct answer.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
4 years ago
What export format is a great option for students that want to put their video into an online portfolio?
emmasim [6.3K]

Answer:

The answer is it depends on the videos that you will be using.

Explanation:

<em>If the student video is lenghty, the best format to use is MOV. (stands for MOVie by Quicktime) Because .mov files are designed for long, movie - like videos that doesn't take up much storage space but the quality is high. For streaming purposes, the best video format would be .WMV (or Windows Media Video). Although, quality of these videos are not that high, it is suitable for online quality as it loads faster. If the student would want his or her movie could be played in most devices, whether it is apple or android, the best format to use is .MP4 (stands for MPEG-4 or Moving Picture Experts Group). MP4 video files are often small and designed for portable devices. It is the most popular movie file type on the internet as it also supports streaming and subtitles. </em>

3 0
3 years ago
A(n) _____ is a computer network that uses Internet Protocol technology to share information, operational systems, or computing
belka [17]

Answer:

The answer is A - INTRANET.

Explanation:

Option B is not the correct answer. An intercom is a stand-alone voice communications system for use within a building or small collection of buildings, functioning independently of the public telephone network. Intercoms are generally mounted permanently in buildings and vehicles

Option C is not the correct answer. In telecommunication, a transponder is a device that, upon receiving a signal, emits a different signal in response.

Option A is the correct answer. An intranet is a computer network for sharing corporate information, collaboration tools, operational systems, and other computing services only within an organization.

3 0
3 years ago
Which data type is used to teach a Machine Learning (ML) algorithm during structured learning?
Evgen [1.6K]

Answer:

the data type is used is training data.

Explanation:

7 0
3 years ago
Lists and Procedures Pseudocode Practice For each situation, provide a pseudocoded algorithm that would accomplish the task. Mak
Andrei [34K]

Answer:

The pseudocoded algorithm is as follows:

Procedure sumOdd(lotsOfNumbers):

    oddSum = 0

    len = length(lotsOfNumbers)

    for i = 0 to len - 1

         if lotsOfNumbers[i] Mod 2 != 0:

              OddSum = OddSum + lotsOfNumbers[i]

Print(OddSum)

Explanation:

This defines the procedure

Procedure sumOdd(lotsOfNumbers):

This initializes the oddSum to 0

    oddSum = 0

This calculates the length of the list

    len = length(lotsOfNumbers)

This iterates through the list

    for i = 0 to len-1

This checks if current list item is odd

         if lotsOfNumbers[i] Mod 2 != 0:

If yes, the number is added to OddSum

              OddSum = OddSum + lotsOfNumbers[i]

This prints the calculated sum

Print(OddSum)

6 0
3 years ago
Other questions:
  • Television broadcasts were originally delivered by using which technology
    14·1 answer
  • The wireless spectrum, as defined by the fcc, spans between which two frequencies?​
    7·1 answer
  • Jorge needs to print out an essay he wrote but he does not have a printer his neighbor has a printer, but her internet connectio
    12·1 answer
  • Some languages are traditional programming languages for developing applications; others, such as markup and scripting languages
    12·1 answer
  • A void function can return any value. TRUE FALSE
    8·1 answer
  • Ye lust, and have not: ye kill, and desire to have, and cannot obtain: ye fight and war, yet ye have not, because ye ask not.​
    15·1 answer
  • Dad Mystery
    9·2 answers
  • Explica porque se afirma que la existencia de estaciones cambia las combstumbres y la cultura​
    14·1 answer
  • Everyone say bye to brainly cause I’m reporting it for being against the law
    10·2 answers
  • Get ready to be the Quizmaster! You are going to design your own Python game show in the style of a quiz.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!