Answer:
def countup():
pass
def countdown():
pass
x = int(input("Choose a number: "))
if x >= 0:
countup()
if x < 0:
countdown()
Explanation:
I start by getting a user input which is saved to variable called "x." I then make if statements to see whether is greater than, equal to, or less than 0. After that, I call the functions.
Answer:
// program in java.
import java.util.*;
// class definition
class Main
{
// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// object to read input
Scanner scr=new Scanner(System.in);
System.out.print("Enter the String:");
// read string from user
String str=scr.nextLine();
System.out.print("Enter the character:");
// read character
char ch=scr.next().charAt(0);
// variable to count the occurrence of character
int char_count=0;
for(int i=0;i<str.length();i++)
{
// find the character i string
if(ch==str.charAt(i))
// increase the count
char_count++;
}
// print the count
System.out.println("count of "+ch+" in the String is:"+char_count);
}catch(Exception ex){
return;}
}
}
Explanation:
Read a string from user and assign it to variable "str".Then read a character to and assign it to variable "ch".Then Declare a variable "char_count" to count the occurrence of character in the string.Find the count of character in the string. Here upper case character is different than lower case.
Output:
Enter the String:Monday
Enter the character:n
count of n in the String is:1
Enter the String:Nobody
Enter the character:n
count of n in the String is:0
Answer:
1. Surge protector.
2. Power-saving mode.
3. Hardware and software.
4. Hard disk.
5. Eject.
Explanation:
1. A surge protector is a device used to protect computers against surges and spikes in power.
2. Sleep and Hibernate are examples of Power-saving modes.
3. Regular maintenance on a computer is good for both hardware and software.
4. Bad sectors are sections of the hard disk that are physically damaged.
5. To protect some devices such as flash drives and external hard drives from corruption, it is best to eject the devices.
Answer:
computer works on electricity
Explanation:
<span>The
first widely adopted windows product, Windows 3, featured a standardized
look and feel, similar to the one made popular by Apple's Macintosh
computer
.
</span>
Microsoft’s Windows operating system was first introduced in 1985, Windows 3 which was released in 1990 was the first version to see more widespread success, because it had the ability to run MS-DOS programmes in windows which brought multitasking in programming.