Answer:
24
Explanation:
11000 is equivalent to 24 because if you look at a flippy do, the base is 2. so going from right-left, 2^0 is 1 for the first 0. second zero would be 2^1 which is 2. then the third zero is 4 (2^2). since they are zero’s, they are turned off, but the 1’s indicate that those bases are turned on. the first one going from right to left would then be 8 (2^3) and the last 1 going from right-left is 16 (2^4). so 16+8=24!
edit: didn’t mean to rate myself 1 star lol
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.
My throat crazyyyyyyy
-xoxoxo
A compiler's initial phase is lexical analysis. It reads changed source code written in the form of phrases from language preprocessors. By deleting any whitespace or comments in the source code, the lexical analyzer converts these syntaxes into a set of tokens. See how reserved words are added below.
<h3>How are reserved words added on the lexical analyzer?</h3>
When the lexical analyzer reads the target program code, it examines it letter by letter, and when it encounters a whitespace, operator symbol, or special symbol, it determines that a word has been finished.
Using the float floatvalue as an example, while scanning both lexemes until it reaches 'float,' the lexical analyzer is unable to determine whether it is a reserved word float or the details of a keyword float value.
According to the Longest Match Rule, the lexeme scanned should be decided by the longest match among all possible keywords.
The lexical analyzer also uses rule priority, which means that a reserved term, such as a keyword, of a language takes precedence over human input.
That is, if the lexical analyzer detects a lexeme that resembles any existing reserved term, an error should be generated.
Learn more about the lexical analyzer at;
brainly.com/question/13211785
#SPJ1
Here are the basics of C++...
Number 1. Printing text onto the screen:
std::cout << "Your text here\n";
The \n creates a new line.
Number 2. Initializing variables and setting variables
There are a few different types of variables in C++...
Integers, floats, chars, and strings.
To let C++ know what type of variable you are about to create, you put the type before the variable name.
Here are some examples:
int number = 10;
float r = 2.45;
char[4] = "Code";
string name = "Bob";
Number 3. Comments
In programming comments are very useful. They help other programmers understand your code.
To make a single line comment in C++ you do this:
// your comment
To make a multi-line comment in C++ you do this:
/*
My multi-line comment here
*/
Number 4. Math
In C++ you have math operators. These operators are + - * / %
I'm pretty sure you are familiar with the first four operators. But you may not know the last one. Don't worry... I'll explain that one to you.
Addition:
std::cout << 35 + 23 // this will print out 58
Subtraction:
std::cout << 102 - 56; // this will come out as 46
Multiplication:
std::cout << 34 * 9; // product will be 306
Division:
std::cout << 164 / 4; // quotient will be 41
Modulus:
Now we get to the operator you may or may not know. The modulus.
The modulus operator gets the remainder of division of a by b.
std::cout << 10 % 4; // it will print out 2
You can even store math operations in variables...
int answer = 40 + 38;
std::cout << answer; // this will print out 78
You can even add variables...
int x = 28;
int y = 58;
int answer = 86;
std::cout << answer;
std::cout << x + y;
Number 5. Comparison Operators.
Comparison operators compare two values to see if its true or false...
These are mainly used in if statements...
Here are the comparison operators:
== Equal
!= Not equal
> Greater than
< Less than
<= Less or equal
>= Greater or equal
Number 6. If Statements
This is the structure of an if statement:
if(...){
// execute code if true
} else if(...){
// execute this block of code if first if statement was false
}else {
// execute this block of code if false
}
if(2 > 1) {
std::cout << "2 is greater than 1";
}
The code above will indeed execute. Because two is greater than 1.
Number 7. Functions
If you have a block of code that will be repeated multiple times through out your program, functions will be handy.
To make a function you must specify the type of the function. This called the return type.
Which are int (integers), floats (decimals), and string (strings).
There are more, but I decided to focus on those three.
Then you give your function a name.
int my_function(){
// your code
}
To call a function, you simply type the name of the function with parentheses.
my_function();
To make a function with parameters, do same thing above, except in the parentheses you give your parameters.
int my_function(int x, int y){
// your code
}
As you can see, you separate the parameters with a comma.
in my_function(int x, int y){
int z = x + y;
std::cout << z; // this will print out the sum of x and y
}
To call your function with parameters, type your function name with parentheses and in the parentheses type your values.
my_function(3, 4); // this will print out 7
Also, another type of function is the void type. In int type functions, at the end of your code in the function, you should type return 0.
This allows C++ know that code wen't without any errors...
In void type function this isn't really necessary...
If you have anymore questions or you found something to be confusing or you want to learn more C++, please write me a message.