Does anyone know how to write this right? This is for a coding class and I’m super confused on it.

First activity:

1. Declare three variables: firstSnack,
second Snack, and thirdSnack.
Assign the name of a snack (as a string)
to each variable.

2. Declare another variable and call it
bestSnack.
Assign a value to bestSnack USING THE
NAME OF ONE OF THE ABOVE VARIABLES.
Do not use a string directly.

3. Now, change your mind! Reassign the value
of bestSnack, again using the variable name,
not the string. (THIS SHOULD BE DONE ON
A NEW LINE)

Second activity:

4. Declare three variables and give them the names of three common grocery items. Assign to each variable a NUMBER value approximately its price. Don’t use $ sign, just the actual number.

5. Declare another variable, name it total, and assign to it the SUM of the three other variables, contain. Hint - you’ll need to use an arithmetic operator to do this.

Answers

Answer 1

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.


Related Questions

Can someone help me please?

Answers

Answer:

ummm this is hard i think answer is 5 robuk am pro

Explanation:

cuz me say soo

What is the maximum number of guesses it will take to find a number
between 1 and 64?

Answers

Answer:

10?

Explanation:

qbasic program to check whether an entered number is positive or negative or neutral​

Answers

Answer:

CLS

INPUT "Enter a number: ",N

IF N > 0 THEN

PRINT "The number is Positive."

ELSEIF N < 0 THEN

PRINT "The number is Negative."

ELSE

PRINT "The number is Zero."

END IF

END

8
Select the correct answer from each drop-down menu.
The AND operator narrows
your search results. The OR operator broadens your search resul
Result. Am I right?

Answers

Answer:

yes you are correct

the AND operator narrows

the OR operator broadens your search results

Answer:

yes your right

(:

Explanation:

You can open an HTML document only in ________.
A. Internet Explorer
B. M.S Excel
C. Note Pad
D. None of these
please solve it fast its urgent ​

Answers

Answer:

You can open a HTML document in internet explorer usually browsers can open HTML files.

pasagot po pls
tle-6​

Answers

Of art check TV ex ex hvubib if tff do

which data type consumes the least storage space?
text
OLE object
yes/no
memo​

Answers

Answer:

yes/no

Explanation:

Since yes /no has a storage of only 1 bit. Text max. 250 characters, memo 65,535 characters, OLE object 4G.B.

which way do you swipe in the android os to access shortcuts on the notification bar?

Answers

Answer:

you swipe downwards

please vote me brainliest thanks:)

A laptop can be kept on palm to work. [true/false) ​

Answers

Answer:

Explanation:

false

is a technique for breaking a problem down into smaller, less complex parts.



A- Pattern recognition
B- Decomposition

Answers

Decomposition hope this helps :)

Answer:

B) decomposition

Explanation:

I got it right on the test

you can use view the ______ file to view the hard drive details.

Answers

Answer:

/proc/partitions

search engines use software that combs the web to find webpages and add new data about them to the database. what is this software called?

Answers

Answer:

They basically use a technology called spider or web crawling, it basically just comb through the internet to find websites or webpages.

please give brainliest.

An advantage of a private home network is that is typically more secure than public Wi-Fi.

Answers

Answer:

yes it's true

Explanation:

please mark brainiest

Answer:

I agree on that.

Explanation:

Of course you can use a vpn to encrypt your data being sent to router but it is easier to just connect to a private network.

Hope this help please give the brainliest award would be much appreciated.

Which is the most protective and secure anti virus software?

Answers

Answer:

In most cases you should just use an anti virus software that comes with that operating system. But if you would like a third party application try using kaspersky anti virus in my opinion it is simple and user friendly. It can most probably block any malware expect for ones that are new like one day old, it will take somwhile to add it to the database.

What is the two’s compliment of -95,-122,-111,-57

Answers

Answer:

-95 0101 1111

-122= 0111 1010

-111= 0110 1111

-57 = 0011 1001

Explanation:

two's Compliment of

- 95 = 0101 1111

-122= 0111 1010

-111= 0110 1111

-57 = 0011 1001

I will make you brainless Just answer this question!!

A. Arrange the follow stpes chronologically.Write A the first step,Bfor the second and so on.​​

Answers

Answer:

1. 3

2. 8

3. 2

4. 6

5. 4

6. 5

7. 9

8. 1

9. 7

Explanation:

Im not sure about this but I hope it helps

The number 8 is actually first

Write pseudocode for one or more selection statements to decide whether a year is a Leap year. The rules are:

A year is generally a Leap Year if it is divisible by 4, except that if the year is divisible by 100, it is not a Leap year, unless it is also divisible by 400. Thus 1900 was not a Leap Year, but 2000 was a Leap year.

Answers

Year = input()

isLeapYear= false
if Year%4 = 0
if Year%100 != 0 or Year%400 == 0
isLeapYear = true
print(isLeapYear)

In this exercise we have to use the knowledge of the python language to write the code, so we have to:

The code is in the attached photo.

So to make it easier the code can be found at:

Year = input()

isLeapYear= false

if Year%4 = 0

if Year%100 != 0 or Year%400 == 0

isLeapYear = true

print(isLeapYear)

See more about python at brainly.com/question/26104476

who is considered as the father of computer?​

Answers

Charles Babbage is considered as the father of computer......

Answer:

Charles Babbage is considered the "Father of Computing"

did someone hang themselves on the wizard of oz set

Answers

Answer:

false

Explanation:

false it is a myth you

As a member of your barangay,how will you help your community in improving solid waste management?

Answers

Answer:

Reuse materials whenever possible. Recycle materials and organize for government and industry to develop community recycling programs. Collect, transport, and store wastes safely.

Review the items below to make sure that your Python project file is complete. Once you have finished reviewing your variables.py assignment, upload it to your instructor.1. Make sure your variables.py program prints the following things, in this order:a) Hello world!b) Spamc) Eggsd) SpamEggse) Spam Eggsf) Spam Eggsg) 7 9h) 20i) 13j) 5k) 13l) 10.8m) 2.72. Make sure that you have saved your program. TIP: If there is an asterisk before the file name in the variables.py text editor window, you need to save your work.

Answers

Answer:

print('Hello world!')

print('Spam')

print('Eggs')

print('SpamEggs')

print('SpamEggs')

print('Spam Eggs')

print(7)

print(20)

print(13)

print('5k')

print(13)

print('10.8m')

print(2.72)

Explanation:

Integers and floats don't need quotes, but if you want to combine it with a string, then you need a quote. Hope that this solution is what you are looking for!

What is word in computer?

Answers

Answer:

In computing, a word is the natural unit of data used by a particular processor design. A word is a fixed-sized piece of data handled as a unit by the instruction set or the hardware of the processor.

This the answer you wanted? (brainliest?)

what is my assurance wireless account number and pin

Answers

Answer:

Call Assurance Wireless at 1-(888)-898-4888 to access your account number. Your PIN is the 6-digit (or 10-digit) number you created, which is located on your welcome letter. Your account number can be found in the top right corner of any bill or by logging into your online account. Do not enter any dashes or hyphens.

Explanation:

pls mark as brainliest and hope this helps

It should be noted that your assurance wireless account number can be found at upper right-hand corner of any bill, and the PIN is the 4 digits that was given to the carrier during the call in.

According to the question, we are to discuss how individuals can know his assurance wireless account number as well as the pin.

As a result if this we can see that the Account number can be obtained at  upper right-hand corner of bill as well as invoice, and the pin is usually 4 digit number.

Therefore, your assurance wireless account number upper right-hand corner of any bill.

Learn more about wireless account number at:

https://brainly.com/question/13162939

in 2014, what percentage of the world population has access to the internet?

Answers

Answer:

At that time 43.9% of people have access to the global internet.

Bàil: Cho số nguyên N=10, Dãy A gồm các số: 26 30 6 37 4|15 21 526 2
a) Tim Max, Min của dãy số
c) Sắp xếp dãy số thành dãy không tăng
d)ChoK=21 vảk=10. Tm chỉ số i sao cho ai=k

b) Sắp xếp dãy số thành dãy không giảm

Answers

Answer:

Bàil: Cho số nguyên N=10, Dãy A gồm các số: 26 30 6 37 4|15 21 526 2

a) Tim Max, Min của dãy số

c) Sắp xếp dãy số thành dãy không tăng

d)ChoK=21 vảk=10. Tm chỉ số i sao cho ai=k

b) Sắp xếp dãy số thành dãy không giảm

Bàil: Cho số nguyên N=10, Dãy A gồm các số: 26 30 6 37 4|15 21 526 2

a) Tim Max, Min của dãy số

c) Sắp xếp dãy số thành dãy không tăng

d)ChoK=21 vảk=10. Tm chỉ số i sao cho ai=k

b) Sắp xếp dãy số thành dãy không giảmBàil: Cho số nguyên N=10, Dãy A gồm các số: 26 30 6 37 4|15 21 526 2

a) Tim Max, Min của dãy số

c) Sắp xếp dãy số thành dãy không tăng

d)ChoK=21 vảk=10. Tm chỉ số i sao cho ai=k

b) Sắp xếp dãy số thành dãy không giảm

Explanation:

Bàil: Cho số nguyên N=10, Dãy A gồm các số: 26 30 6 37 4|15 21 526 2

a) Tim Max, Min của dãy số

c) Sắp xếp dãy số thành dãy không tăng

d)ChoK=21 vảk=10. Tm chỉ số i sao cho ai=k

b) Sắp xếp dãy số thành dãy không giảmBàil: Cho số nguyên N=10, Dãy A gồm các số: 26 30 6 37 4|15 21 526 2

a) Tim Max, Min của dãy số

c) Sắp xếp dãy số thành dãy không tăng

d)ChoK=21 vảk=10. Tm chỉ số i sao cho ai=k

b) Sắp xếp dãy số thành dãy không giảm

Please please help ASAP please

Answers

Answer:

he say yes would i do so way 2 be hey i oh peepo

Explanation:

how to disappear completely from the internet pc magazine

Answers

In order to disappear completely from the internet, one needs to delete their social media accounts, delete their emails, etc.

The internet is a network of interconnected computer systems. Despite its numerous advantages, it also has several disadvantages and there are some moments when we want to disappear from the internet.

The steps that are needed to disappear from the internet include:

Delete your social network accounts.Delete your email accounts.Use search engines to track your old activities online and delete them.Falsify the accounts that can't be deleted.Unsubscribe from mailing lists.

Read related link on:

https://brainly.com/question/24902823

what is the answer ??​

Answers

Answer:

D all of the above

B operating system

the person above ^ me is correct

How do people decide their ethical behavior

Answers

Explanation:

Ethical behavior is based on written and unwritten codes of principles and values held in society. Ethics reflect beliefs about what is right, what is wrong, what is just, what is unjust, what is good, and what is bad in terms of human behavior.

Answer:

most people go by the crowd to the way they act. theres are also people who have to make very hard decisions and not everyone makes the right choice.

Explanation:

What is the difference between a filter and a Search Folder?

*manually & *on demand

Answers

Answer:

manually and on demand is correct

Explanation:

Other Questions
2.Which force stops the car from moving? which plane divides the body into right and left halves The ratio of fruit juice to water is 1:5. Howmuch water is needed to make 12 liters ofpunch? John used the following scale drawing to create a diagram of his bedroom. Each square is 1 cm. If the side of his desk that touches the wall is 3 m long, how long are the sides of the shelf that touch the walls? Jerry works on a hotels front desk. He's been asked to write a short email reminding all the staff when the next fire alarm test will happen. What information must Jerry include in the email? i will give brainliest Allowing 16 % discount on the marked price of a television and levying 13 % VAT, a buyer has to pay Rs 18,984 to buy it. Find the marked price of the Television. what three patterns of biodiversity did darwin observe Find the value of f(3) y=f(x) identify where Specialised cells are found,the job and the adaptation of:Nerve cellSperm cellRed blood cell Egg cell Which equation represents a line that passes through the points (4, 5) and (6, 9)? Multiple choice question. 5. What was an outcome of the wars for independence in Latin America? I WILL GIVE 30 POINTS TO THOSE WHO ANSWER THIS QUESTION RIGHT. What are some myths and misconceptions about ancient/medieval Africa? How can we combat or change these myths? Qu opinin merece los versos" inventa mundos nuevos y cuida tu palabras, el adjetivo, cuando no da vida , mata? Can you help me find the missing sides and calculate the perimeter? Mona is a teacher.works in a college. (Choose she/her) Which words are missing? What's the study of earth and its atmosphere ? John bought a quart of ice-cream for $4.80. How much does the ice-cream cost per cup? 1 guart = 4 cups Trey is buying a computer onsale. The origina Price was4200. If the sale price is 5/6 ofthe original Price . How much didtrey pay for the computer?