Answer:
do{
cout<<"Introduce number \n"; //print the message
cin>>num; //set the value of the number given
}while(num<1 || num>10); //repeat while the number is out of the range
cout<<"Number: "<<num; //print the number
Explanation:
The idea behind this code is to create a loop in which I can compare the number given (between 1 and 10) and then print the number or get back and ask the number again.
#include <iostream>
using namespace std;
int main()
{
int num; //create num variable
do
{
cout<<"Introduce number \n"; //print the message
cin>>num; //set the value of the number given
}while(num<1 || num>10); //repeat while the number is out of the range
cout<<"Number: "<<num; //print the number
}
You can address 2^16 words and each word is 8 bit (= 1 byte). Therefore it is 64 KB.
If the word size was 16 bit. The answer would be 128 KB.
Answer:
# Get input and strip any leading/trailing spaces
inputList = input('Enter list: ').strip()
def issorted(lst):
if len(lst) < 2:
return True
current = 1
prev = 0
while current < len(lst):
# Compare if current value is less than the previous one
if int(lst[current]) < int(lst[prev]):
return False
prev = current
current += 1
return True
# Convert input to list
inputList = inputList.split(' ')
# Print output
if issorted(inputList):
print("The list is already sorted")
else:
print("The list is not sorted")
Answer:
provide all of the nondefault methods that are listed in the interface, with the exact signatures and return types specified
Explanation:
I am assuming the programming language is Java. Actually, none of the answers are 100% correct, but this one is the only one that is partially correct. The reason is the class implementing an interface can be abstract, and in this case it may not provide ALL nondefault methods.
Answer: Excel spreadsheet
Explanation: I took a test with the same question