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
statuscvo [17]
3 years ago
12

Rules used in naming variables in object oriented programming​

Computers and Technology
1 answer:
schepotkina [342]3 years ago
4 0

Answer:

Explanation: Name your variables based on the terms of the subject area, so that the variable name clearly describes its purpose.

You might be interested in
Define a method printAll() for class PetData that prints output as follows with inputs "Fluffy", 5, and 4444. Hint: Make use of
Vsevolod [243]

Answer and Explanation:

public class petData

{

private int ageYears;

private String fullName;

private int IdNumber;

public void setName (String givenName)

{

fullName = givenName;

return;

}

public void setAge (int numYears)

{

ageYears = numYears;

return;

}

public void setID (int numID)

{

IdNumber = numID;

return;

}

public void printAll ()

{

System.out.print ("Name: " + fullName);

System.out.print (", Age: " + ageYears);

return;

}

}

From the above, we have defined a class petData, with methods setName, setAge, printAll. These methods all make use of the string variable fullName and integer variable ageYears. From the above, setName method sets fullName variable to name given to its string parameter givenName while setAge method does the same with the ageYears variable in initializing it. This is also done by the ID method. These variables are then used by printAll method in printing out the Name and age of the object which would be created with the petData class

E. g: petData dog= new petData();

3 0
4 years ago
During Which model states that communication can occur simultaneously?
SVETLANKA909090 [29]

Answer:

i dont see any models...please include a picture

8 0
3 years ago
Adjectives to describe programming skills
Ronch [10]

Answer:

Here are some adjectives for programmer: archetypal `real, ultimate navigational, former lucid, one-year-old professional, year-old professional, media-friendly genetic, inevitable seven-year, >gical, adgical, ever silent and phlegmatical, silent and phlegmatical, ]real, extremely defensive, and brilliant cryptographic.

8 0
3 years ago
Write the definition of a function named printpoweroftwostars that receives a non-negative integer n and prints a line consistin
Aleksandr-060686 [28]
To accomplish this without using a loop,
we can use math on a string.

Example:
print("apple" * 8)

Output:
appleappleappleappleappleappleappleapple

In this example,
the multiplication by 8 actually creates 8 copies of the string.

So that's the type of logic we want to apply to our problem.

<span>def powersOfTwo(number):
if number >= 0:
return print("*" * 2**number)
else:
<span>return

Hmm I can't make indentations in this box,
so it's doesn't format correctly.
Hopefully you get the idea though.

We're taking the string containing an asterisk and copying it 2^(number) times.

Beyond that you will need to call the function below.
Test it with some different values.

powersOfTwo(4) should print 2^4 asterisks: ****************</span></span>
4 0
4 years ago
QUICK PLZZZZZZZ Which one of the following is considered a peripheral? A Software B Mouse C USB connector D Motherboard
il63 [147K]

A MOUSE is considered a peripheral. A peripheral device connects to a computer system to add functionality.

6 0
3 years ago
Other questions:
  • How do i stream from my chromebook to my tv?
    8·1 answer
  • You notice that somehow you have duplicate records for some of your clients in your database. What should you do?
    13·2 answers
  • If r is an instance of the above Person class and oddNum has been declared as a variable of type boolean, which of the following
    8·1 answer
  • Which of the following patterns should be used for the delimiter to read one character at a time using a Scanner object's next m
    7·1 answer
  • Minerals can form deep inside Earth’s crust by
    13·1 answer
  • Choose all of the items that represent operating systems largely derived from UNIX. GNU/Linux, Mac OS X, IBM, OS/360, BSD, Windo
    12·2 answers
  • To answer the research question "How am I going to find the information I need on the tople?" the best thing Georgia should
    15·1 answer
  • Write a program that reads 20 integers from the user into an array and uses a function arrayMinimum that accepts an integer arra
    5·1 answer
  • What is the difference between spyware and adware?
    8·2 answers
  • The essential idea behind digital cite zen shop is that ____.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!