Answer:
public class SwitchCase {
public static void main(String[] args) {
int num = 0;
int a = 10, b = 20, c = 20, d = 30, x = 40;
switch (num){
case 102: a += 1;
case 103: a += 1;
case 104: a += 1;
case 105: a += 1;
break;
case 208: b += 1; x = 8;
break;
case 209: c = c * 3;
case 210: c = c * 3;
break;
default: d += 1004;
}
}
}
Explanation:
- Given above is the equivalent code using Switch case in Java
- The switch case test multiple levels of conditions and can easily replace the uses of several if....elseif.....else statements.
- When using a switch, each condition is treated as a separate case followed by a full colon and the the statement to execute if the case is true.
- The default statement handles the final else when all the other coditions are false
Answer:
int counter = 0;
String userInput = "";
while (userInput != "stop") {
print "What pet do you have? ";
userInput = readInputLine();
if (userInput != "stop" ){
counter = counter + 1;
print "\nYou have one ";
print userInput;
print ". Total # of Pets: ";
print counter;
}
}
Explanation:
not sure what programming language you use, therefore the answer is pseudocode but it should give you an idea how to implement a piece of code for this problem.
Also, from the way you described the exercise I'm not sure if you always are supposed to reply with "you have one" + the pet or if you should count how often the same pet was entered.
Answer:
border: 5px solid lightgreen;
Explanation:
The shorthand version of the border property in CSS goes as follows:
border: <line-width> <line-style> <color>;
With <line-width> represents the thicknes of the border line (expressed in keyword values or lenght values), <line-style> represents the style of the border, and <color> represents the color of the border (in color names or values).
Answer:
Vulnerable business processes, also called business process compromise (BPC), occurs when an attacker manipulates commonplace actions that are routinely performed.
Answer:
see explaination
Explanation:
//selective dev elements by id name
var gradeA = document.querySelector("#GradeA");
var passing = document.querySelector("#Passing");
var learning = document.querySelector("#Learning");
//function showGrades
function showGrades() {
var arr = [];
//converting string to int and inserting into array
arr[0] = parseInt(gradeA.textContent);
arr[1] = parseInt(passing.textContent);
arr[2] = parseInt(learning.textContent);
//creating json blob
var blob = new Blob(new Array(arr), {type:"text/json"});
return blob;
}