Answer:
Explanation:
The following program is written in Javascript. It creates a prompt that asks the user for his/her name and saves it in a variable called userName. Then it uses that variable to welcome the user. A test case is shown in the images below with the desired output.
let userName = prompt("Enter Your Name")
alert(`Hello ${userName}`)
Answer:
Step by step explanation along with code and output is provided below
Explanation:
#include<iostream>
using namespace std;
// print_seconds function that takes three input arguments hours, mints, and seconds. There are 60*60=3600 seconds in one hour and 60 seconds in a minute. Total seconds will be addition of these three
void print_seconds(int hours, int mints, int seconds)
{
int total_seconds= hours*3600 + mints*60 + seconds;
cout<<"Total seconds are: "<<total_seconds<<endl;
}
// test code
// user inputs hours, minutes and seconds and can also leave any of them by entering 0 that will not effect the program. Then function print_seconds is called to calculate and print the total seconds.
int main()
{
int h,m,s;
cout<<"enter hours if any or enter 0"<<endl;
cin>>h;
cout<<"enter mints if any or enter 0"<<endl;
cin>>m;
cout<<"enter seconds if any or enter 0"<<endl;
cin>>s;
print_seconds(h,m,s);
return 0;
}
Output:
enter hours if any or enter 0
2
enter mints if any or enter 0
25
enter seconds if any or enter 0
10
Total seconds are: 8710
Answer:
true!
Explanation:
its better to know your password :))
Answer:
Following are the program in the Python Programming Language.
#Set integer type variable
letter = 6
#Set integer type variable
Possibility = 26
#Set variable to store total Possibilities
total =Possibility ** letter
#print variable
print(total)
Explanation:
<u>Following are the description of the program</u>.
- Firstly, we set an integer type variable 'letter' and initialize it to 6.
- Then, we set another integer type variable 'Possibility' and initialize it to 26.
- Set an integer type variable 'total' that stores the number of the possible passwords that can be created from 6 letters.
- Finally, print the variable 'total'.