Answer:
The solution code is written in Python 3.
- import random
-
- count = 0
- flag = False
- guess = int(input("Input your guess (2-12): "))
-
- while(count <=3):
- dice1 = random.randint(1, 7)
- dice2 = random.randint(1, 7)
-
- if((dice1 + dice2) == guess):
- flag = True
-
- count += 1
-
-
- if(flag):
- print("User wins!")
- else:
- print("Computer wins!")
Explanation:
A Random generator is needed for this question and therefore we start by importing Python random class (Line 1)
Next, create one counter variable,<em> count</em>, to ensure there will be only three rolling of the dices (Line 3). We need another variable, <em>flag</em>, to track the status if the two dices equal to the <em>guess</em> number chosen by user (Line 4).
Next, prompt use to input a guess number (Line 5).
Within the while loop, we can use random class method <em>randint() to </em>generate random integer. The arguments 1 and 7 will give one random number ranged from 1 to 6 for <em>dice1</em> and<em> dice2</em>, respectively (Line 8 - 9).
If the total of<em> dice1 + dice2</em> equal to user <em>guess</em>, we turn the<em> flag </em>to <em>True</em>. If not, the <em>flag </em>will remain <em>False</em> after completing entire while loop.
If the <em>flag </em>turned to <em>True</em>, print the message "User Wins!" else print the message ("Computer wins!")
Answer:
In Java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int mnth, yr;
Scanner input = new Scanner(System.in);
System.out.print("Month: "); mnth = input.nextInt();
System.out.print("Year: "); yr = input.nextInt();
boolean lpYear = (yr % 4 == 0 && yr % 100 != 0) || (yr % 400 == 0);
if(mnth == 1 || mnth == 3 || mnth == 5 || mnth== 7 || mnth == 8 || mnth == 10 || mnth == 12){
System.out.print("31 days"); }
else if(mnth == 2){
System.out.print(((lpYear) ? "29 days" : "28 days")); }
else if(mnth == 9 || mnth == 6 || mnth == 4 || mnth== 11){
System.out.print("30 days"); }
else{ System.out.print("Invalid"); }
}
}
Explanation:
See attachment for complete program where comments were used as explanation.
Answer:
Well, it depends. Sometimes the extra programs can be useful or just plain fun, in which case the answer is yes. But extra programs can also sometimes be utterly useless and get in the way, in which case the answer is no.\
Answer:
QoS
Explanation:
We could use a blacklisting or a MAC filtering to remove from the network, and in this way, we're going to get a high portion of bandwidth, but other must work too, and the whitelisting have almost the same function, but QoS Quality of service is specifically for these cases where we need high bandwidth for a video conference, we can make this with some tools or techniques like jitter buffer and traffic shaping.
The word application is used to write documents, to write and edit business letters, to save documents that will be used again...
Selecting the Word application using desktop shortcut is one possible way of opening the Word application. Another method that is acceptable for opening the Word application is selecting the Word application pinned on the task bar.