Renewable energy is energy that is collected from renewable resources, which are naturally replenished on a human timescale, such as sunlight, wind, rain, tides, waves, and geothermal heat.
Answer:
The solution code is written in Python 3
- digits = input("Enter 9 digits: ")
-
- multiplier = 1
- total = 0
-
- for x in digits:
- total += int(x) * multiplier
- multiplier += 1
-
- checksum = total % 11
-
- if(checksum == 10):
- print(digits + "X")
- else:
- print(digits + str(checksum))
Explanation:
Firstly, use input function to get user input for 9 digits (Line 1)
Next we can use a for-loop to estimate the summation (d1 * 1 + d2 * 2 + d3 * 3 + d4 * 4 + d5 * 5+ d6 * 6 + d7 * 7 + d8 * 8 + d9 * 9) ( Line 6-8)
Then only apply % operator to get the remainder of total and get the checksum (Line 10)
Next create if and else statement to print the digits string joined with X if checksum is 10 else join digits string with checksum value (Line 12 -15)
He must consider all of these because the database is the foundation and you Will come to a lot of problems later on in the road if the foundation is faulty
Answer:
Commands: commands are also known as "programs" and the program is a set of rules that performs a specific task which is executed by a computer.
Unix is an operating system. that supports multi-tasking and multi-user functionality. Unix is most widely used in all forms of computing systems such as desktop, laptop, and servers. It provides a Graphical user interface similar to windows.
The Unix operating system there are various commands. The list of five Unix commands can be given as:
1) cal
2) date
3) banner
4) who
5) whoami
1)cal:
The cal command stands for calender. It displays the date.
Syntax:
$ cal
or
$ cal [[month] year]
Example:
$ cal 10 2019
2)date:
The date command stands for date and time. It displays the system date and time.
Syntax:
$date
or
$ date[+format]
Example:
$ date +%d/%m/%y
3) banner
The banner command stands for display the text in to a large size.
Syntax:
$banner message
Example:
$banner Unix
4) who
The who command stands for display the list of users currently logged in.
Syntax:
$who
or
$who [option] … [file][arg1]
Example:
$who
5) whoami
The whoami command stands for display the user id of the currently logged-in user.
Syntax:
$whoami
Example:
$whoami
Explanation:
1)cal command display the current month and year.
2)date command display system date and time.
3)banner command display text in large size.
4)who command display the user name who currently login.
5)whoami command display user id.
Answer:
Check the explanation
Explanation:
Here is the program with function definition and two sample calls.
Code:
#include <iostream>
using namespace std;
//checkMe FUNCTION which takes values a, b and c
void checkMe(char &a, int &b, int &c)
{
//if sum of b and c is negative and a is 'n', b and c are set to 0, otherwise a is set to 'p'
if((b+c)<0 && a=='n')
{
b = 0;
c = 0;
}
else
{
a = 'p';
}
}
int main()
{
//first test case when else part is executed
char a = 'n';
int b = 5;
int c = 6;
checkMe(a, b, c);
cout<<a<<" "<<b<<" "<<c<<endl;
//second test case when if part is executed
a = 'n';
b = -4;
c = -5;
checkMe(a, b, c);
cout<<a<<" "<<b<<" "<<c<<endl;
return 0;
}
Kindly check the Output below: