Podcast
Questions and Answers
What is the correct syntax for checking if the number of overtime hours exceeds 10?
What is the correct syntax for checking if the number of overtime hours exceeds 10?
What message will be printed if both users are not feeling great in the given scenario?
What message will be printed if both users are not feeling great in the given scenario?
What is the correct way to calculate tax based on deposits according to the given scenario?
double balance = Console.getDouble(“Balance £ ”);
double deposits = Console.getDouble(“Deposits £ ”);
double withdrawals = Console.getDouble(“Withdrawals £ ”);
double tax = 0.0;
What is the correct way to calculate tax based on deposits according to the given scenario? double balance = Console.getDouble(“Balance £ ”); double deposits = Console.getDouble(“Deposits £ ”); double withdrawals = Console.getDouble(“Withdrawals £ ”); double tax = 0.0;
What is the correct syntax for checking the cost and calculating fees based on the given scenario?
What is the correct syntax for checking the cost and calculating fees based on the given scenario?
Signup and view all the answers
What does SCM stand for?
What does SCM stand for?
Signup and view all the answers
What is Github?
What is Github?
Signup and view all the answers
What loop variation is recommended when the number of loop executions is known in advance?
What loop variation is recommended when the number of loop executions is known in advance?
Signup and view all the answers
What does GitLab provide as an alternative to Github?
What does GitLab provide as an alternative to Github?
Signup and view all the answers
What is the purpose of a while-loop?
What is the purpose of a while-loop?
Signup and view all the answers
What is the correct way to calculate architect's fee based on the cost of the building?
What is the correct way to calculate architect's fee based on the cost of the building?
Signup and view all the answers
What is the purpose of the 'if' statement in programming?
What is the purpose of the 'if' statement in programming?
Signup and view all the answers
In the given code, what is the purpose of the 'if' statement?
int rentalDays = Console.getInt(“Number of rental days: ”);
// Calculate the cost when each day costs £55
double cost = rentalDays * 55.0;
// check if discount due
if (rentalDays >= 7) {
double discount = cost / 100 * 25;
cost = cost – discount;
}
System.out.println(“Rental Cost £ “ + String.format(”%.2f”,cost));
In the given code, what is the purpose of the 'if' statement?
int rentalDays = Console.getInt(“Number of rental days: ”);
// Calculate the cost when each day costs £55 double cost = rentalDays * 55.0; // check if discount due if (rentalDays >= 7) { double discount = cost / 100 * 25; cost = cost – discount; } System.out.println(“Rental Cost £ “ + String.format(”%.2f”,cost));
Signup and view all the answers
What does the 'if-else' statement allow in programming?
What does the 'if-else' statement allow in programming?
Signup and view all the answers
In the given code, what is the purpose of the 'if-else' statement? double SRATE = 10.0, ORATE = 15.0;
int standard = Console.getInt(“Number of standard hours: ”);
int overtime = Console.getInt(“Number of overtime hours: ”);
double wages = standard * SRATE; // calculate standard wages
// calculate overtime (only allowed up to 10 hours overtime)if (overtime > 10) {
wages = wages + (10 * ORATE);
} else {
wages = wages + (overtime * ORATE);
In the given code, what is the purpose of the 'if-else' statement? double SRATE = 10.0, ORATE = 15.0; int standard = Console.getInt(“Number of standard hours: ”); int overtime = Console.getInt(“Number of overtime hours: ”); double wages = standard * SRATE; // calculate standard wages // calculate overtime (only allowed up to 10 hours overtime)if (overtime > 10) { wages = wages + (10 * ORATE); } else { wages = wages + (overtime * ORATE);
Signup and view all the answers
What is the purpose of the 'discount' variable in the given code?
What is the purpose of the 'discount' variable in the given code?
Signup and view all the answers
What is the purpose of the 'else' block in the 'if-else' statement?
What is the purpose of the 'else' block in the 'if-else' statement?
Signup and view all the answers
What does the 'if' statement do if the boolean condition is false and there is no 'else' block?
What does the 'if' statement do if the boolean condition is false and there is no 'else' block?
Signup and view all the answers
What is the purpose of the 'cost' variable in the given code?
What is the purpose of the 'cost' variable in the given code?
Signup and view all the answers
What is the purpose of the 'wages' variable in the given code?
What is the purpose of the 'wages' variable in the given code?
Signup and view all the answers