Question

In: Computer Science

This is continue from my last post. I will need it to be done in the...

This is continue from my last post. I will need it to be done in the next hour. Please answer in short answer and explain.

What value is contained in the integer variable count after the following statements are executed?

count = 4;

count - count % 4;

count = count * 10;

count = count + 10;

7. What value is contained in the floating point variable area after the following statements are executed?

area = 3.14;

area = area / 10;

area = area * 0.5;

8. What value is contained in the integer variable sum after the following statements are executed?
sum = 15;
sum = sum % 3;
sum += 500;
sum *= 2;

Solutions

Expert Solution

Ques 6:

The value of count at the end should be 10.

Explanation:

Initially the count is set to 4.

Second line, count = count % 4

evaluates to count = 4%4 = 0

Third line, count = count * 10

evaluates to count = 0 * 10 = 0

Fourth line, count = count + 10

evaluates to count = 0 + 10 = 10.

Ques 7:

The value of area at the end is 0.157000

Explanation:

First line, assigns 3.14 to the area variable.

Then, second line divides the value by 10. which makes it 0.314

Then, third line multiplies 0.5 with the area value.

SO, it becomes 0.157000

Ques 8:

The value of sum will be 1000

Explanation:

sum = 15 assigns 15 to the variable sum.

Then, second line, assigns 15%3 to sum again.

That is 0.

Third line adds 500 to the variable sum, that is 0+500 = 500.

In the last line, sum is multiplied by 2.

So it becomes 500*2 = 1000.

PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!


Related Solutions

This is a post from one of my classmate from a group discussion. I need a...
This is a post from one of my classmate from a group discussion. I need a response for this post. Thanks! “Imperialism refers to an imbalance of power in the political sphere, usually among nations. It happens when a stronger nation takes over a weaker one and seeks to gain control of its people, economy and culture.” When you look at the effects on Africa, it is hard to believe that there was a benefit for its native people. When...
I need a answer to my professors question about my discussion post My Post 1) What...
I need a answer to my professors question about my discussion post My Post 1) What types are protected? Under the National Labor Relation Act, an employee's right to strike is a considered as a critical component of the right to organize. But to ensure balance this right is not without limitations. As per Section 7 of NLRA only Certain strikes qualify as protected activity. These recognized strikes are: ·         Unfair labor practice strikes, which protest employers illegal activities. ·        ...
I need fast for my Courseworks, need al least 4 hours after i post this question....
I need fast for my Courseworks, need al least 4 hours after i post this question. 1. Explain About Linear Antenna And Surface Antenna and gives some examples! 2. What is Major Direction and Null Direction of EM Waves Radiation Thank you for your answer! I'll appreciate it. Need answer for both of question
Why are my questions not answered? I am waiting and waiting and desperately need it done....
Why are my questions not answered? I am waiting and waiting and desperately need it done. Here: A new business client comes to your office. There are three owners of the business. The three individuals, Alan, Bob, and Carol, are thinking about forming a partnership. Alan is only investing $1 million in cash. He will not have anything to do with the daily activities of the business. Bob has had some experience in the business and will be responsible for...
""""" I need new post to accepted my homework """"" Assignment Questions: There are four macro...
""""" I need new post to accepted my homework """"" Assignment Questions: There are four macro strategies to create and deliver value to customers and that can help a firm to develop a sustainable competitive advantage. Think of companies from the local market who you are very loyal to in many categories like (food, electronics, personal care etc.). Is it the product, location, operational, or customer excellence that you are loyal to that firm? Critically examine. (2.5 Marks) You have...
I need a few unit tests done on my SelectionSort program in Visual Studio 2019 with...
I need a few unit tests done on my SelectionSort program in Visual Studio 2019 with MSTest. My program is below. I just need screen shots of the unit test code in Visual Studio 2019 with MSTest. Please and thank you. so easentially I need someone to write some unit tests with my program in MSTest visual studio 2019. Then I need the unit tests supplied as answers. using System; namespace SelectionSortAlgorithm { public class SelectionSort { public static void...
?I need a discussion response to my peers discussion post in our Money and Banking Class....
?I need a discussion response to my peers discussion post in our Money and Banking Class. Please see below One of the foremost persistent explanations for the 2008 monetary crisis-especially among economists-is the notion that financial policy within the early to mid-2000s was answerable for making the Brobdingnagian housing value bubble that brought on the crisis once it folded in 2007. The argument is definitely plausible. Overly low interest rates would boost investment in real assets and aggressive reach for...
I need a response to my peers discussion post The Federal Reserve uses its various tools...
I need a response to my peers discussion post The Federal Reserve uses its various tools to end the recession in an economy. Federal reserve mainly uses open market operation which includes buying and selling of government securities by the Fed to affect the supply of money. To control recession, Fed buys government securities in the open market which increases the money supply in the economy and helps to overcome the recession phase. This improves the economy in time when...
I need a 250 word discussion post on the following for my class MAN 3326 Industrial/Organizational...
I need a 250 word discussion post on the following for my class MAN 3326 Industrial/Organizational Psychology Mira Smith is the human resources director for a manufacturer of airline parts in Montreal. The environment of the company is one of high stress, and Smith realized that she needed to take the steps to ensure that the stress would not affect the physical and psychological health of her firm’s employees. Based on what you have read in Chapter 15 discuss what...
Please Typing this My Summary from reading Chapter I need to fix My Words and make...
Please Typing this My Summary from reading Chapter I need to fix My Words and make Clear for understanding Thanks In section 4, it discusses how to adequately deal with your time. Time the board is a significant resource that you have to cause you to have as an understudy. This Part expresses half of understudies experience difficulty dealing with their time in their first year of school. School is a major distinction from secondary school, and a great deal...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT