Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Questions are from Visual C# Fifth edition Given the following segment of code, what will be the value of x, y, z, and count after

Questions are from "Visual C# Fifth edition"

  1. Given the following segment of code, what will be the value of x, y, z, and count after all statements are executed?

int x = 6

int y = 5;

int z = 3;

for (int count = 1; count <=8; count += 3)

{

If (x >= 4 || y < 13)

{

X -= 1;

Y += x;

}

Z +=y/x;

}

  1. Assume a file sales.txt is in the default location. Write C# statement(s) to calculate the sum of all sales numbers in sales.txt and add the additional line The total sales is ___. to the file sales.txt. You should put the total sales number in the currency format in the blank. For example, if there are two sales number in the sales.txt, i.e. 34.56 and 12.23. You should add the sentence The total sales is $46.79. in the sales.txt file.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions

Question

What forces have led to the boom in entrepreneurship in the United?

Answered: 1 week ago