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.
Answer:
Some computer science stuff I guess
Answer:
Explanation:
The following is written in Java. It creates the trafficLight class which holds the currentLight string variable and a int count variable for the number of times the light has been red. It also contains two constructors one that takes the currentLight as a parameter and one that does not. Finally, it has the next() method which analyzes the currentLight status and changes it to the next light. Output can be seen in the attached picture below.
class Brainly
{
public static void main(String[] args)
{
trafficLight traffic_light = new trafficLight();
System.out.println("Current Light: " + traffic_light.currentLight);
traffic_light.next();
System.out.println("Current Light after change: " + traffic_light.currentLight);
}
}
class trafficLight {
String currentLight;
int count = 0;
public trafficLight(String currentLight) {
this.currentLight = currentLight;
}
public trafficLight() {
this.currentLight = "red";
count++;
}
public void next() {
if (this.currentLight == "green") {
this.currentLight = "yellow";
} else if (this.currentLight == "yellow") {
this.currentLight = "red";
count++;
} else {
this.currentLight = "green";
}
}
}
Answer: UTF-8 (Unicode transformation format) is a technique that is capable of producing any character in Unicode standard.
Explanation: UTF-8 is supporting technique that helps in changing any block of bits of any language.It is used for converting any code into the unicode characters.It was created because this coding technique that supports various languages and is also replacing the ASCII code. UTF-8 code is highly compatible with the ASCII codes and has better properties than it.
Answer:
Online activities are increasingly used to make real-world decisions.
Explanation:
People use increasingly <em>world wide web</em>. They create profiles and communicate with others on social networks, share thoughts and moments of their life on online platforms.
These <em>online</em> activities become part of one's identity. Therefore these activities can give information about user's behaviors, attitudes, likes and dislikes.
All this data are being used to make real world decisions about a user or a group of users. For example, trough one's online check-ins, frequently used location of the users or can be determined. Similarly, trough social media likes or posts, one's hobbies can be predicted.
Therefore, social media and online presence in general, is not necessarily safe or private but important places which have valuable information of the users that can be used in real world.