When defining a class, it is a best practice to declare ____ as private. constructors mutators nothing should be private accessors variables

Answers

Answer 1

Answer:

The answer is "variables".

Explanation:

It is necessary to declare a variable privately when declaring a class because the private variable 'protects' the code while it is in operation. It may not aim to protect it at this stage from changing the codes themselves for other developers. Its purpose of the so-called "data hiding" is to hold the internal data from many other classes using the class protected.


Related Questions

File
Home
Insert
Formulas
Data
Review
View
Automate
Help
Editing
Calibri Light
16
B
Bra Av
2
CS
General
G
A
B
С
D
E
F
L
H
1
3
3 In cell D7, create a formula that calculates the tax for the invoice. Us
a
sales tax rate of 7.5%
SABROSA
Catering Invoice
Sabrosa Empanadas & More
1202 Biscayne Bay Drive
Orlando, FL 32804
Invoice #:
6710A Date:
10/15/20
In cell Ds, create a formula that finds the total for the order. In other
this formula should add cells D3:07.
Empanadas & More
1
In cell D9 create a formula that calculates the total after a 10% disco
you need help understanding how to take a percentage off of a total
LINE TOTAL
2 MENU ITEM
3 Empanadas: Buffalo Chicken
4 Empanadas: Braised Short Rib
5 Empanadas: Fig and Goat Cheese
6 Sides: Black beans and rice
7
UNIT PRICE
$2.98
$2.98
$3.75
$1.98
QUANTITY
20
30
25
40
TAX
8
TOTAL
TOTAL AFTER DISCOUNT:
9
+
Catering Invoice Catering Subtotal challenge
C Mode tomate Workbook to
Helo improve Office
100%
-

Answers

Explanation:

formula should add cells D3:07.

Empanadas & More

1

In cell D9 create a formula that calculates the total after a 10% disco

you need help understanding how to take a percentage off of a total

LINE TOTAL

2 MENU ITEM

3 Empanadas: Buffalo Chicken

4 Empanadas: Braised Short Rib

5 Empanadas: Fig and Goat Cheese

6 Sides: Black beans and rice

7

UNIT PRICE

$2.98

$2.98

$3.75

$1.98

QUANTITY

20

30

25

40

TAX

8

TOTAL

6.2 lesson practice

Answers

Answer:

I am guessing it would be 20

Explanation:

In the draw canvas text code the last number from the color is probably the font size.

Correct me if I'm wrong

Write a program that reads an integer between o and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all the digits is 14. Hint: Use the % operator to extract digits, and use the / operator to remove the extracted digit. For instance, 932 % 10=2 and 932/10 =93. Here is a sample run:
Enter a number between 0 and 1000 : 999
The sum of digits is 27.

Answers

Answer:

Answered below

Explanation:

#Program is written in Python programming language

digit = 0

sum = 0

num = int(input("Enter a number between 0 and 1000: ")

#Check that number is within the valid range

if num > 0 and num <= 1000:

while num != 0:

#Isolate each digit

digit = num % 10

sum = sum + digit

#Remove isolated digit from number

num = num/10

else:

print("Number is not within valid range")

#print total sum of digits

print(sum)

If you wanted to help your phone , a nonliving thing , perform the process of life which is to gain energy which would be the best description of what to do ?

Help

Answers

Answer:

d. plug it into the charger.

Explanation:

Assuming dataFile is an ofstream object associated with a disk file named payroll.dat, which of the following statements would write the value of the salary variable to the file
A) cout < B) ofstream C) dataFile << salary;
D) payroll.dat <

Answers

Answer:

dataFile << salary;

Explanation:

To write salary to a file (payroll.dat) using ofstream, you make use of the following instruction:

ofstream dataFile;

myfile.open ("payroll.dat");

myfile <<salary;

myfile.close();

This line creates an instance of ofstream

ofstream dataFile;

This line opens the file payroll.dat

myfile.open ("payroll.dat");

This is where the exact instruction in the question is done. This writes the value of salary to payroll.dat

myfile <<salary;

This closes the opened file

myfile.close();

write an algorithm to find the average of six numbers​

Answers

Answer:

Input: two numbers x and y Output: the average of x and y Step 1 : input x,y Step 2: sum=0,average=0 Step 3:sum = x + y Step 4:average = sum /2 Step 5: print average.

Explanation:

Input: two numbers x and y Output: the average of x and y Step 1 : input x,y Step 2: sum=0,average=0 Step 3:sum = x + y Step 4:average = sum /2 Step 5: print average.

Algorithms are set of instructions which are to be followed in other to solve a particular problem. The algorithm which gives the average of six values goes thus:

1.)

Input : a, b, c, d, e, f

#takes input of the six numbers

2.)

sum=0 ; average=0

# initialize sum and average variables to 0

3.)

sum = a + b + c + d + e + f

#takes the sum of the six numbers

4.)

average = sum /6

#divide the sum by the number of values.

5)

print average.

#display the average value

Learn more : https://brainly.com/question/24266817

A network interface card was installed on Shawn's computer. The function of a network interface card is to _____.


enable his computer to be connected to a network

keep his documents secure

store files that can be shared

speed up his computer

Answers

Answer:

The correct answer is Option 1: enable his computer to be connected to a network

Explanation:

Network interface card, as it is clear from the name, is added to the computer system to enable the computer to connect to the internet. If a computer doesn't have network interface card, it cannot connect to the internet.

Hence,

The correct answer is Option 1: enable his computer to be connected to a network

Answer:

enable his computer to be connected to a network

Conside following prototype of a function
int minArray(int [], int );
Which of the option is correct way of function CALL assuming following arraydeclaration
int x[5] = {7,4,6,2,3};*
a) minArray(x,5);
b) minArray(x[],10);
c) minArray(x[5],5);
d) minArray(5,x);

Answers

Answer:

The answer is "Option a"

Explanation:

Following are the code to this question:

#include <stdio.h>//header file

int minArray(int x[], int n)//defining method minArray that accepts two parameters

{

   for(int i=0;i<n;i++)//defining loop for print value

   {

    printf("%d\n",x[i]);//printf array value

   }

}

int main()//defining main method

{

int x[] ={7,4,6,2,3};//defining array that hold values

int n=5;//defining integer variable

minArray(x,5);//calling method minArray

return 0;

}

In this code, a method "minArray" is defined, that accepts two parameters array and an integer variable in its parameter, and in the next step, the for loop is declared, that uses the print method to prints its value.

In the next step, the main method is declared, which declared an array and holds its values and defines an integer variables, and calls the method "minArray".

Social media marketing began in the mid
1970s
1980s
1990s
2000s

Answers

Answer:

1990's i think

Explanation:

ve phenotypk percentages of the offspring​

Answers

It’s true have a nice day

Choose the type of collection created with each assignment statement. collectionA = {5:2} collectionB = (5,2) collectionC = [5, 2]

Answers

Answer:

CollectionA is Dictionary

CollectionB is List

CollectionC is Tuple

Explanation:

List is recognized by the square brackets

Tuple by the parentheses

Dictionary by the curly brackets

Answer:

Dictionary collectionA

Tuple collectionB

List collectionC

Explanation:

A dictionary uses curly brackets. A tuple uses parentheses. A list uses square brackets.

Do you think it’s better for a young designer to use free, open-source art programs or to pay for commercial programs? Explain your answer, but come up with at least one counterargument that forces you to defend your position when you explain why you think one option is better than the other.

Answers

Answer:

I think that if you are starting you should use a free, open-source art program. Because starting up with alot of things like this is hard with no money but the resources that we have could help with that. That's why I think the free one is better than paying, especially monthly pay.

Explanation:

what time is spellrd the same forwards and backwards​

Answers

12:21 is the correct answer

If an ISP assigned you a /28 IPv6 address block, how many computers could be as- signed an address from the block?

Answers

Answer:

I think 14 hosts (computer)

Which of the following groups might sign a non-disclosure agreement between them?

the local government and its citizens

a group of employees or contractors

a company and an employee or contractor

two competing businesses or companiesc​

Answers

Answer: I believe the right answer is between a company and employee or contractor.

Explanation: I think this is the answer because a non-disclosure is a legal contract between a person and a company stating that all sensitive. information will be kept confidential.

Answer:a

Explanation:

Exercise 1.3.5: Expressing conditional statements in English using logic. info About Define the following propositions: c: I will return to college. j: I will get a job. Translate the following English sentences into logical expressions using the definitions above: (a) Not getting a job is a sufficient condition for me to return to college. (b) If I return to college, then I won't get a job. (c) I am not getting a job, but I am still not returning to college. (d) I will return to college only if I won't get a job. (e) There's no way I am returning to college. (f) I will get a job and return to college..

Answers

hope this helps!!!. i worked hat

Consider the following code segment.
firstList + ["guitar", "drums", "bass"]
secondList + ["flute", "violin"]
thirdList = []
thirdList + firstList
firstList secondList
secondlist thirdList
What are the contents of secondList after the code segment is executed?
А
[]
00
["guitar", "drums", "bass"]
с
["flute", "violin"]
D
["flute", "violin", "guitar", "drums", "bass"]

Answers

Answer:

[tex]secondList = ["guitar", "drums", "bass"][/tex]

Explanation:

At the third line of the code segment:

An empty list thirdList is created

At the fourth line of the code segment:

The content of firstList is passed into thirdList

i.e. [tex]thirdList = ["guitar", "drums", "bass"][/tex]

At the fifth line of the code segment:

The content of secondList is passed into firstList

i.e. [tex]firstList =  ["flute", "violin"][/tex]

At the fifth line of the code segment:

The content of thirdList is passed into secondList

i.e. [tex]secondList = ["guitar", "drums", "bass"][/tex]

At Moore High, 456 students attended the prom. This is 65 more students than
the previous year.
To the nearest percent, what is the percent of increase from last year to this
year?
12%
15%
17%
19%

Answers

Answer:

B-15%

Explanation:

Yes I agree the answer is B 15%

The tool chest for programmers is also known as the CPU.
True or False?

Answers

Explanation:

I would say yes, but I'm not sure

Yeah I’m pretty sure it’s true

What email program would you suggest and why?

Answers

Answer:

An email program

Explanation:

And why?

Answer:

I would suggest g m a i l.

Explanation:

I use G m a i l all the time and I think it is easy to use! A lot of people think it is great too! :)

write down the name of output devices

Answers

Answer:

Monitor

Printer

Headphones

Computer Speakers

Projector

GPS

Sound Card

Video card

Explanation:

monitor

printer

headphones

computer speakers

projector

GPS

sound card

video card

hope it helps you

plese follow me

Boolean, integer, string, and float are examples of:
constants.
recursions.
loops.
variables.

Answers

Answer:

variables

Explanation:

They are all examples of variables

Most Information Technology careers require workers to perform their jobs in
A. a home office.
B. a business office.
C. a secure office.
D. an off-site office.

Answers

Answer:

b on edge 2020

Explanation:

Answer:

b

Explanation:

Difference between analog and digital computer ??

Answers

Answer:

The analogue computer works on a continuous signal. The digital computer works on a discrete signal. The output is a voltage signal, they are not exact values and are in graphical form.

1.16 LAB: Input and formatted output: House real estate summary Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two inputs, current price and last month's price (both integers). Then, output a summary listing the price, the change since last month, and the estimated monthly mortgage computed as (currentPrice * 0.051) / 12 (Note: Output directly. Do not store in a variable.).
Ex: If the input is:
200000 210000
the output is:
This house is $200000. The change is $-10000 since last month.
The estimated monthly mortgage is $850.0.
Note: Getting the precise spacing, punctuation, and newlines exactly right is a key point of this assignment. Such precision is an important part of programming.
import java.util.Scanner;
public class LabProgram {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int currentPrice;
int lastMonthsPrice;
currentPrice = scnr.nextInt();
lastMonthsPrice = scnr.nextInt();
/* Type your code here. */
}

Answers

Answer:

Please find the complete code and the output in the attachement.

Explanation:

In the code, a class "LabProgram" is defined, and inside the main method two integer variable "currentPrice and lastMonthsPrice" is defined that uses the scanner class object is used for a user input value, and in the next step, two print method is declared that print the calculate of the integer variable.

The program is an illustration of output formats in Java

The statements that complete the program are:

System.out.printf("This house is $%d. The change is $%d since last month.\n",currentPrice,(currentPrice - lastMonthsPrice));System.out.printf("The estimated monthly mortgage is $%.1f.\n",(currentPrice * 0.051)/12);

To format outputs in Java programming language, we make use of the printf statement, followed by the string literal that formats the required output

Take for instance:

To output a float value to 2 decimal place, we make use of the literal "%.2f"

Read more about Java programs at:

https://brainly.com/question/25458754

III. FILL-IN THE BLANK (five points each)
11. Open divided scales have scales going in
directions.
12. There are
groups of scales.
13. The open divided scales have an
unit preceding zero.
14. The triangular scale can have up to
different scales on one piece of plastic.
15. The mechanical inch is divided into
equal parts.

Answers

Jsjejshxjskksnxbfbsjchjsjens

The Circle and CircleTester have been created, but they have errors. The public and private settings for variables and methods are not all correct.
Your job is to go through and fix them. You will need to make edits in both files to get them working correctly, but once complete, your output should match the output below.
Sample Output:
Circle with a radius of 5.0
The diameter is 10.0
The perimeter is 31.41592653589793
CIRCLE.JAVA
public class Circle {
public double radius;
private Circle(double myRadius) {
radius = myRadius;
private void setRadius(int myRadius){
radius = myRadius;
}
private double getDiameter() {
return radius*2;
}
public double getRadius() {
return radius;
}
private double getPerimeter() {
return Math.PI*getDiameter();
}
private String toString() {
return "Circle with a radius of " + radius;
}
}
CIRCLE TESTER.JAVA
public class CircleTester {
public static void main(String[] args) {
Circle circ = new Circle(10);
circ.radius = 5;
System.out.println(circ);
System.out.println("The diameter is " + circ.getDiameter());
System.out.println("The perimeter is " + circ.getPerimeter())
}
}

Answers

Answer:

CIRCLE.JAVA

public class Circle {

  private double radius;

  public Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 public double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 public double getPerimeter() {

   return Math.PI*getDiameter();

 }

 public String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}

Explanation:

public class Circle {

  //This could be made private or public.

  //Making it private is better

  private double radius;

  //This is a constructor. It should be made public

  //since it would most likely be used in another class

  //to create an object of this class.

  //Making it private means no other external class can create

  //an object of this class.

  //Since the tester class (CIRCLETESTER.java), as shown on line 3,

  // needs to create

  //an object of this class, this should be made public

  public Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 //This should be made public since it will be

// used in another class (CIRCLETESTER.java in this case)

 public double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 //This should be made public since it will be

 //used in another class (CIRCLETESTER.java)

 public double getPerimeter() {

   return Math.PI*getDiameter();

 }

 //The toString() method is the string representation

 //of an object and is called when there is an attempt to

 //print the object. It should be made public since it will

 //be used in another class (CIRCLETESTER.java)

 public String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}

Lesson 3 - Calling All Operators
Exit
37 of 42
Test
Reset
order
75
do
create variable amount ToCoupon
75 +
order
print
"To receive a coupon, you will need to spend $ >
amount ToCoupon
print
Code
Check the customer's order amount. If it is less than $75, determine how much more
needs to be spent to reach $75 and give the customer that information.
< PREV

Answers

Answer:

.m

Explanation:

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to print two random integers between (and including) 0 and 9. End with a newline. Ex:
5.
7.
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, after calling srand() once, do not call srand() again. (Notes)
1 #include
2 #include //
3 Enables use of rand ()
4 int main(void) ( int seedval;
6.
7. scanf ("%d", &seedval);
8.
9.
10 srand(int seedval);
11 printf("%d\n", srand());
12 printf("%d\n", srand());
13
14 return e;
15 }

Answers

Answer:

#include<stdio.h>

#include<stdlib.h>

int main(void){

int seedval;

scanf ("%d", &seedval);

srand(seedval);

printf("%d\n", rand()%10);

printf("%d\n", rand()%10);

 return 0;

}

Explanation:

The given code is poorly formatted. So, I picked what is usable from the code to write the following lines of code:

#include<stdio.h>

#include<stdlib.h>

int main(void){

This line declares seedval as integer

int seedval;

This line gets user input for seedval

scanf ("%d", &seedval);

This line calls the srand function to generate random numbers

srand(seedval);

This prints a random number between 0 and 9

printf("%d\n", rand()%10);

This also prints a random number between 0 and 9

printf("%d\n", rand()%10);

 return 0;

}

Consider the following class designed to store weather statistics at a particular date and time:
public class WeatherSnapshot
{
private int tempInFahrenheit;
private int humidity; // value of 56 means 56% humidity
private int dewPoint; // in degrees Fahrenheit
private String date; // stores the date as a String
private int time; // in military time, such as 1430 = 2:30 pm
private boolean cloudy; // true if 25% or more of the sky is covered
// constructor not shown, but it initializes all instance variables
// postcondition: returns temperature
public int getTemp()
{
return tempInFahrenheit;
}
// postcondition: returns date
public String getDate()
{
return date;
}
// postcondition: returns true if precipitation is likely; false otherwise
public boolean precipitationLikely()
{
// implementation not shown
}
// other methods not shown
}
Suppose a WeatherSnapshot object named currentWeather has been correctly instantiated in a client class. Which of the following will correctly call the precipitationLikely method?
A. boolean couldRain = precipitationLikely();
B. boolean couldRain = currentWeather.precipitationLikely();
C. boolean couldRain = currentWeather.precipitationLikely(true);
D. double percentChanceOfRain = precipitationLikely();
E. double percentChanceOfRain = currentWeather.precipitationLikely();

Answers

Answer:

The answer is "Option b".

Explanation:

In this question, It took the boolean parameter, which may use the couldRain as the precipitationLikely precipitation method as the boolean variable because the precipitationLikely is not a static type, and it can name this method utilizing object is called currentWeather, that's why the choice b is correct.

Other Questions
FileHomeInsertFormulasDataReviewViewAutomateHelpEditingCalibri Light16BBra Av2CSGeneralGABDEFLH133 In cell D7, create a formula that calculates the tax for the invoice. Usasales tax rate of 7.5%SABROSACatering InvoiceSabrosa Empanadas & More1202 Biscayne Bay DriveOrlando, FL 32804Invoice #:6710A Date:10/15/20In cell Ds, create a formula that finds the total for the order. In otherthis formula should add cells D3:07.Empanadas & More1In cell D9 create a formula that calculates the total after a 10% discoyou need help understanding how to take a percentage off of a totalLINE TOTAL2 MENU ITEM3 Empanadas: Buffalo Chicken4 Empanadas: Braised Short Rib5 Empanadas: Fig and Goat Cheese6 Sides: Black beans and rice7UNIT PRICE$2.98$2.98$3.75$1.98QUANTITY20302540TAX8TOTALTOTAL AFTER DISCOUNT:9+Catering Invoice Catering Subtotal challengeC Mode tomate Workbook toHelo improve Office100%- hiii please help! ill give brainliest if you give a correct answer tysm! if you like riddles answer this whoever gets it right wins the brainliestDavid's father has three sons: Snap, Crackle, and _____?the answer is........ ill tell yall who got it right What is the solution for the system of equations shown in the graph?WILL GIVE BRAINLY IF ANSWER 2p+18=200 solve for p show your work Rewrite as a simplified fraction. 0.51 = ?the one is repeating btw What is your opinion on the use of stem cells, obtained from fertilized eggs or early stage embryos In the chemical formula 2SO2, how many total atoms of oxygen (O) are there? what is the formula of moment of force Mary drove from her home to the library. After she left the library, she drove to the park. After that, she drove home. The map shows the path she took.What is the distance between (4, 3) and (9, 15) on the coordinate plane? Select two that apply.How far did Mary drive? a 10 miles b 14 miles c 24 miles d 28 miles factor polynomial x^ + 9x + 20 Replace the values of A, b, x, and y to write an exponential equation that represents the number of cells present at h hours. Which is greater, 0.9 or 95%? Which of the following situations generally exists when disinflation occurs?Select one:a. the rate of inflation is falling from 5% to 3%b. the rate of inflation falling from 3% to -2%c. 3% decrease in inflation and 2% fall in unemployment rated. 5% increase in inflation and 3%increase in unemployment rate= the rate of inflation is falling from 5% to 3% External conflict is a struggle with an outside force. Which of the following are examples of external conflict?a. A sailor must sail his small ship through a violent storm. b. A girl feels guilty about lying and confesses to her parents. c. A boxer faces his rival in the boxing ring.d. A teenager gets a role in the school play and must face his stage fright. plz help i need it quick!!! simplify If voters can not vote on election day they can cast an ___ ballot before the election or participate in ____ voting What are the DNA strands called?What is the RNA stand called? How can the Declaration of Independence impact future generations? You owe $1,000 on a credit card and choose to pay the minimum payment eachmonth. Which answer is correct?OA.Making minimum payments is the smart thing to do. I know this is true,since I asked the credit card company!Credit card companies love you when you only make minimum payments!OB. Why? You're throwing your money away by paying extra interest eachmonth.OC.Making minimum payments is a great way to have more cash in yourpocket.OD. Everyone pays the minimum payment.