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
butalik [34]
3 years ago
8

An instance variable name of type String, initialized to the empty String. An instance variable score of type int, initialized t

o zero. A method called setName that has one parameter, whose value it assigns to the instance variable name. A method called setScore that has one parameter, whose value it assigns to the instance variable score. A method called getName that has no parameters and that returns the value of the instance variable name. A method called getScore that has no parameters and that returns the value of the instance variable score.
Computers and Technology
1 answer:
timofeeve [1]3 years ago
8 0

Answer:

public class Class {

   private String name ="";

   private int score = 0;

   //Method SetName

   public void setName(String newName){

       name = newName;

   }

//Method SetScore

   public void setScore(int newScore){

       score = newScore;

   }

//Method GetName

   public String getName() {

       return name;

   }

//Method GetScore

   public int getScore() {

       return score;

   }

}

Explanation:

  • The class called Class is implemented in Java programming language
  • It has two fields (instance variables name and score)
  • Methods for setting the values of variables (mutator methods) or setters
  • Methods for getting the values of the variables (accessor methods) getters
You might be interested in
Which description best applies to a macro?
Mama L [17]

A macro is that pseudo-program that performs a list of actions based on a set of instructions.

<h3>What is macro?</h3>

A macro can be said to be a number of commands that help you to get complex things done via automating simple and via repetitive tasks.

A macro is that pseudo-program that performs a list of actions based on a set of instructions.

Therefore, option A is correct as the macros does a whole lot of work.

Learn more about macro from

brainly.com/question/20050035

#SPJ1

6 0
2 years ago
Which statement is false? Select one: a. A class is to an object as a blueprint is to a house. b. Classes are reusable software
kow [346]

Answer:

A class is an instance of its object

Explanation:

6 0
2 years ago
Which of the following sentences is written in the active voice
STALIN [3.7K]
D. The chocolate cake will be served to the queen. This is the only one not in past tense. Active means present or near present, hence the word "will." 
3 0
3 years ago
Read 2 more answers
Since the value we want to receive is either true or false, it makes the most sense to use:
EastWind [94]

Answer:

Logical Expressions

Explanation:

The expressions  that have logical statements which could be "true or false" are known as logical expressions. These types of expressions are also known as Boolean Expressions.

These expression are used in computer programming. The purpose of these expressions in programming is to make a decision that could be based on different conditions. These conditions could be true or false. This is the main reason that. logical expression makes best sense for values received in true or false.

8 0
3 years ago
Given a sorted list of integers, output the middle integer. assume the number of integers is always odd.
Svetllana [295]

integer userInput

integer i

integer mid

integer array(20) number

userInput = 1

for i = 0; userInput >= 0; i = i + 1

  if number[i] > -1

     userInput = Get next input

     number[i] = userInput

i = i - 1

mid = i / 2

if i > 9

  Put "Too many inputs" to output

elseif i % 2 == 0

  Put number[mid - 1] to output

else

  Put number[mid] to output

4 0
2 years ago
Other questions:
  • I need help please?!!!
    15·1 answer
  • Robin ensures that she is always available if anyone in the team needs her. Which quality is shown by robin?
    9·2 answers
  • Consider the following code segment.
    15·1 answer
  • You are tasked with accumulating survey data on a web page and are responsible for it being free from dirty data once you close
    11·1 answer
  • Connect 5 LEDs with any random colors. Iteratively, turn ON 1 to 5 LED(s) that will take 5 iterations in total, and in every ite
    6·1 answer
  • Why is it important to put the most specific case first? What types of errors does it help avoid?
    11·1 answer
  • Nathaniel wanted to buy a microphone. He went to an electronics store and was told that there are actually two types of micropho
    13·2 answers
  • Any action that causes harm to your computer is called a
    15·1 answer
  • Does anyone have any tips on how to begin a 10 page Capstone project paper? I've got to write a write a research paper on the ty
    14·2 answers
  • Rr lyrae stars pulsate, but with shorter periods and lower luminosities than cepheids. true false
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!