Answer:
Explanation:
The following function/program is written in Java. It asks the user for a sentence as an input and then splits that sentence into an array of words. Then it creates an arrayList for all of the unique words, comparing each word in the sentence with all of those in the ArrayList. If a word is found in the ArrayList it cancels the loop and moves on the next word in the sentence. Finally, it counts all of the unique words in the ArrayList and prints that total to the screen.
public static void uniqueWords() {
Scanner in = new Scanner(System.in);
System.out.println("Enter a sentence:");
String sentence = in.nextLine();
String words[] = sentence.split(" ");
ArrayList<String> uniqueWords = new ArrayList<>();
for (int x = 0; x < words.length; x++) {
boolean exists = false;
for (int i = 0; i < uniqueWords.size(); i++) {
if (words[x].equals(uniqueWords.get(i))) {
exists = true;
break;
}
}
if (exists == false) {
uniqueWords.add(words[x]);
}
}
System.out.println(uniqueWords.size());
}
Answer:
See explaination
Explanation:
#input
o_t_n=int(input('Enter a string of octal digits: '))
#required variables
i = 1
dc = 0
#loop for conversion
while (o_t_n != 0):
#to find remainder
rmd = o_t_n % 10
o_t_n //= 10
dc += rmd * i
i *= 8
#print the results
print('The integer value is ',dc)
# decimalToOctal.py
#input
d_c_n=int(input('Enter a decimal integer: '))
print("Quotient Remainder Octal")
#required variables
i = 1
o_c_n = 0
num=""
#loop for conversion
while (d_c_n != 0):
#to find remainder
rm = d_c_n % 8
d_c_n //= 8
o_c_n = o_c_n + rm * i
i *= 10
num = str(rm)+num
print("%5d%8d%12s" % (d_c_n, rm, num))
#print the results
print('The octal representation is ',o_c_n)
Sixteen candles would be even better if it was a musical
Explanation:
There are three types of loops in programming languages which are as following:-
- for.
- while.
- do while.
The syntax for all the three loops is different.You will see mostly for loop used with the arrays because they are easy to implement.
the syntax of for loop is :-
for(int i=initial value;condition;i++)
{
body
}
In for loops you only have to write the conditions in only line else is the body of the loop.
for example:-
for array of size 50 printing the each element
for(int i=0;i<50;i++)
{
cout<<arr[i]<<" ";
}
You have to initialize i with 0 and the condition should be i<size of the array and then increase the counter.
Answer: This. is an old Asus Board and the chip is missing
Explanation: The BIOS chip goes into the Processor holder. the one with the curved metal arm to help release it (goes into the cage first you use glue made for ) installing the chip, then you place the processor on top of that big part where it resembles a slice of bread. You lock down the four legs and that is the brain of the MB.
To update the BIOS,in the machine outside of the operating system. ON WIndows it is the command center on Mac it is different.
The CMOS Battery is next to the word ASUS .
The BIOS is code and software that you upload from the manufacturer's site like ASUS. and in the command environment, you update the bios.
The CHIP is delicate and it ONLY GOES on ONE WAY! BE Verry very careful installing the chip and processor better to have a pro (like me ) do it ...
Motherboards are very delicate and expensive! All parts go one way and one way only. Be glad you don't have to Sauter anything.