Answer:
// program in C++.
// headers
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// Variable
int num;
cout << "Enter a number between 1 and 10: ";
// read input
cin >> num;
// validate input number
while(num<1||num>10)
{
// if input is wrong then print error message
cout<<"Wrong input!!Enter again:";
// read again
cin>>num;
}
// print output
cout << "The Roman numeral for "<<num<<" is:";
// switch
switch (num)
{
case 1:
// if input is 1
cout<<"I"<<endl;
// exit the switch
break;
case 2:
// if input is 2
cout<<"II"<<endl;
// exit the switch
break;
case 3:
// if input is 3
cout<<"III"<<endl;
// exit the switch
break;
case 4:
// if input is 4
cout<<"IV"<<endl;
// exit the switch
break;
case 5:
// if input is 5
cout<<"V"<<endl;
// exit the switch
break;
case 6:
// if input is 6
cout<<"VI"<<endl;
// exit the switch
break;
case 7:
// if input is 7
cout<<"VII"<<endl;
// exit the switch
break;
case 8:
// if input is 8
cout<<"VIII"<<endl;
// exit the switch
break;
case 9:
// if input is 9
cout<<"IX"<<endl;
// exit the switch
break;
case 10:
// if input is 10
cout<<"X"<<endl;
// exit the switch
break;
// default
default:
break;
}
return 0;
}
Explanation:
Read a number from usr and assign it to variable "num". If the input number is less than 1 or greater than 10 then ask again to enter a number until user enter a number between 1-10 only.Then with the help of switch() function print the equivalent Roman number.
Output:
Enter a number between 1 and 10: -5
Wrong input!!Enter again:12
Wrong input!!Enter again:6
The Roman numeral for 6 is:VI
Answer:
storyboard!!!
Explanation:
its important to have the concept in mind before starting
Answer:
Explanation:
data is a statement like
data 10,20, 30 , 40 , 50, 60 , 70, 80
\\the numbers represent ages.
For x := 1 to end of data do a[x]:=read(data)
\\ This is a comment. You could do this much easier if you just use three if statements rather than the if then else.
minor:=0;adult:=0;senior:=0;
while a[x] <> 0 do begin
age:= a[x]
if age < 19 then minor:=minor + 1;
If age > 18 then if age < 65 the adult:=adult + 1;
if age > 64 then senior := senior + 1;
end;
I have not declared the variables anywhere. That depends on what language you are using. The key step you want are the three if statements. How you find out what's in them is another matter.
Answer:
Keeping the numeric values in a list makes it easier to apply the same computation to every data element.
Explanation:
A list or array in programming is a data structure, that has the location for each item it holds indexed. It eliminates the need to constantly create a variable to compute items of the same data types.
The list can store items of the same data type and iterate over them to compute the same calculation on each of them.
Answer:
A file manager is a type of manager where you manage your files. Thee are many types of functions in a file manager. You can compress certain types of files, you can move delete, etc your files. You can transfer or share certain types of files as well.