Answer:
Explanation: If and else statements are one of the most important parts of programming.
1. You add an if you do something if a condition is met. For example, if number of chocolates equals zero( a condition), and inside you can do something like buy more chocolates. And else statement happens if the if condition isn't met and you want to the code to do something else. You don't need this if you don't want anything to happen if the if condition isn't true.
2. This might be used in a number guessing game. Let's say you have to guess a number, if its correct the computer should correct but if you get it wrong it should display wrong. You can write if the number the user writes in equal to the number you are supposed to guess say correct. Else say wrong
Hope this helps. Please mark as brainliest! Thanks!
Since you did not specify a language i am assuming C
void x10(int n){
printf("%d \n",n*10);
return;
}
Answer:
c = float(input("Enter the temperature in Celsius: "))
f = c * 1.8 + 32
print("The temperature in Fahrenheit: " + str(f))
k = (f - 32) / 1.8 + 273.15
print("The temperature in Kelvin: " + str(k))
Explanation:
*The code is in Python.
Ask the user to enter the temperature in Celsius
Convert the Celsius to Fahrenheit using the conversion formula and print it
Convert the Fahrenheit to Kelvin using the conversion formula and print it
Answer:
By Using the Greedy- Activity- Selection algorithm
Explanation:
The Greedy- Activity- Selection algorithm in this case involves
First finding a maximum size set S1, of compatible activities from S for the first lecture hall.
Then using it again to find a maximum size set S2 of compatible activities from S - S1 for the second hall.
This is repeated till all the activities are assigned.
It requires θ(n2) time in its worse .
Answer:
<em>The right order of steps you should take to repare the laptop is: D A C B</em>
<em>Explanation:</em>
<em>D. Ask yourself if the laptop is still under warranty: Because they will replace the board for you or give you a new machine.</em>
<em>A. Ask yourself if replacing the motherboard will cost more than purchasing a new laptop: since technology evolve every day, you might consider buying a new faster, better, advanced machine.</em>
<em>C. Find the service manual to show you how to replace the motherboard: the support assistence will guide you trhough the right way of replacing the board.</em>
<em>B. Find a replacement motherboard: choose the specific one or maybe try to find a better model, that can improve your computer performance.</em>