Answer:
"You passed the test!"
Explanation:
Here user reading grade "test_score" and checking the student score in "If" condition. If it is less than 60 we are printing "You failed the test!" and if it is >60 we are outputting the string "You passed the test!" and else if it not satisfying any of these then we are printing "You need to study for the next test!".As "test_score" value is 90 which is >60 it satisfies the condition >60. So we are printing the string "You passed the test!"
Answer:
2. <em>A reference of type A can be treated as a reference of type B</em> - False
Base class or its objects are not related to their derived class (or its objects).
Explanation:
class A {
int a;
public A() {
a = 7;
}
}
class B extends A {
int b;
public B() {
b = 8;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
1. <em>After the constructor for class B executes, the variable a will have the value 7 </em>- True.
When an object of a derived class is declared, the constructor of base class is called before the constructor of derived class (is called).
3. <em>Both variables a and b are instance variables </em>- True.
Classes can have instance, or member, variables and methods.
4.<em> After the constructor for class B executes, the variable b will have the value 8</em> - True.
When object of class B is declared, its constructor was called, which initialized variable b to 8.
A program that is required to three (3) numbers. calculate and print their total is given below:
<h3>The Program</h3>
import java.util.Scanner;
public class SumAndAverage {
public static void main(String[ ] args) {
System.out.println("Enter three numbers - ");
// Accepting and finding sum of numbers.
int sum = 0;
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 3; i++)
sum += sc.nextInt( );
// Printing sum and average.
System.out.println("Sum - " + sum);
System.out.println("Average - " + (sum / 3f));
}
}
The output would request three different numbers, then add them up, and display the output of the sum and then display or print their total
Read more about programming here:
brainly.com/question/23275071
#SPJ1
Answer:
Top area of Word, the second segment.
Explanation:
To make it bold, press the "B" button and to change the colour press the "A" underlined with a colour (normally red).
Answer:
Thank you for the free points.