Answer:
This is using c++ syntax, you might need to make slight adjustment for other languages.
First activity:
string firstSnack = "chips";
string secondSnack = "pizza";
string thirdSnack = "apples";
string bestSnack = firstSnack;
bestSnack = secondSnack;
Second activity:
double apple = 0.5;
double banana = 0.75;
double orange = 1.43;
double total = apple + banana + orange;
Explanation:
When first declaring a variable, you want to specify the type (such as int, double, string, bool, etc.) and then the name. You can set the variable value in the declaration, or you can set it to a value later in the program by not having the equals sign and whatever comes next.
Girls are so evil nowadays
Answer:
It create a new file in which writing of data begins.
Explanation:
A file can be open in the three mode:
-r (Read mode): open an existing file for the purpose of reading data from it.
-w (write mode): Create a new file for the purpose of writing data to it.
-a (append mode): open an existing file for the purpose of appending extra data to it but if the file does not exist, it create a new file and start writing data to it.
Answer:
char
Explanation:
The character data type written as char holds any single character, numbers and non-printing characters. In java and most programming languages, the value of the character must be placed within single quotes. for example
char c = 'd'
char c = '9'
char c = '\t'
Are all valid declarations of a variable c as char and assigned d, then 9 and then used with a non-printing character (tab ) with the escape sequence.