Protocol. Like TCP/IP or HTTP etc
Answer:
D. Software Problem
Explanation:
It could be that the software is bootlooping which will power on and off until its fixed.
Answer:
import java.util.Scanner;
public class num6{
static int getTestScores(){
System.out.println("Enter the Score");
Scanner in = new Scanner(System.in);
int score = in.nextInt();
return score;
}
static double calcAverage(int score1, int score2, int score3){
return (score1+score2+score3)/3;
}
static void displayAverage(double ave){
System.out.println("The Average is "+ave);
}
public static void main(String[] args) {
int num1 = getTestScores();
int num2 = getTestScores();
int num3 = getTestScores();
//Calling Calculate Average
double average = calcAverage(num1,num2,num3);
//Calling displayAverage
displayAverage(average);
}
}
Explanation:
- Using Java programming Language
- Create the four methods
- getTestScores() Uses the Scanner Class to receive an in variable and return it
- calcAverage() accepts three ints as parameter calculates their average and return it
- displayAverage() Accepts a double and prints it out with a concatenated string as message
- In the Main Method, getTestScores is called three times to obtain three numbers from the user
- calAverage is called and handed the three numbers
- printAverage is called to output the calculated average
Answer:
no_of_shares = int(input("Enter the number of shares: "))
purchase_price = float(input("Enter the purchase price of the stock: "))
sale_price = float(input("Enter the sale price of the stock: "))
total_stock_price = purchase_price*no_of_shares
total_spend_on_buying = total_stock_price + (0.03*total_stock_price)
total_sale_price = sale_price*no_of_shares
commission_while_selling = total_sale_price*0.03
net_gain_or_loss = total_sale_price - (total_spend_on_buying + commission_while_selling)
if(net_gain_or_loss<0):
print("After the transaction, you lost {} dollars".format(abs(net_gain_or_loss)))
else:
print("After the transaction, you made {} dollars".format(abs(net_gain_or_loss)))