Answer: As the conventional etiquette, which lays out rules of ethics in social contexts, the purpose of netiquette is to help create and sustain a friendly, relaxed and productive atmosphere for online contact, as well as to avoid putting pressure on the system and creating tension between users.
Explanation:
Answer:
#include<iostream>//library inclusion
using namespace std;
int main()
{
int userInput;
do//start of do while loop
{
cout << "Enter a number less than a 100" << endl;
cin >> userInput;
if (userInput < 100) //condition
{
cout << "YOu entered less than a hundred: " << userInput << endl;
}
else
{
cout << "your number is greater than 100" << endl;
}
} while (userInput > 100);//condition for do while
return 0;//termination of int main
}
Explanation:
The program has been commented for you. The do-while loop enters the first loop regardless of the condition. Then after the first iteration, it checks for the condition. If the condition is being met, it will iterate through, again. Otherwise it will break out of the loop and land on the "return 0;" line. Which also happens to be the termination of the program in this case. The if-else condition is used for the user to see when prompted.
The Digital Revolution refers to the advancement of technology from analog electronic and mechanical devices to the digital technology available today. The era started to during the 1980s and is ongoing. ... The Digital Revolution is sometimes also called the Third Industrial Revolution.
Answer:
Here is the program:
current_time = '2014-07-26 02:12:18:'
my_city = ''
my_state = ''
log_entry = ''
my_city = input("") #reads in value for my_city
my_state = input("") #reads in value for my_state
log_entry = current_time + ' ' + my_city + ' ' + my_state #concatenates current_time, my_city and my_state values with ' ' empty space between them
print(log_entry)
Explanation:
You can also replace
log_entry = current_time + ' ' + my_city + ' ' + my_state
with
log_entry = f'{current_time} {my_city} {my_state}'
it uses f-strings to format the strings
If you want to hard code the values for my_city and my_state then you can replace the above
my_city = input("")
my_state = input("")
with
my_city = "Houston"
my_state = "Texas"
but if you want to read these values at the console from user then use the input() method.
The screenshot of the program along with the output is attached.
Answer:
// program in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// string array
string m[3];
// array to store rainfall
double rainfall[3];
// variables
double avg_rainfall,sum=0;
for(int i=0;i<3;i++)
{
cout<<"Enter name of month "<<i+1<<" :";
// read month name
cin>>m[i];
cout<<"Enter rainfall (inches) in month "<<i+1<<" :";
// read rainfall
cin>>rainfall[i];
// sum of rainfall
sum+=rainfall[i];
}
// Average rainfall
avg_rainfall=sum/3;
// print Average rainfall
cout<<"Average rainfall for "<<m[0]<<","<<m[1]<<","<<m[2]<<" is "<<avg_rainfall<<" inches."<<endl;
return 0;
}
Explanation:
Create string array "m" to store name of month and double array "rainfall" to store rainfall. Read name of 3 months and rainfall in that month.Find the sum of all the rainfall and the average rainfall.Print the average rainfall of 3 months.
Output:
Enter rainfall (inches) in month 2 :45
Enter name of month 3 :july
Enter rainfall (inches) in month 3 :43
Average rainfall for may,june,july is 42.6667 inches.