Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Visual Basic studio C# language Give the entire code for the program below to function properly write a program which will ask the user

Using Visual Basic studio C# language

Give the entire code for the program below to function properly

write a program which will ask the user to enter a number from 1-10 and save that number in a variable called num. You should open a file called "myfile.txt" which should start with the number 1 in it only. Your program will open the file, multiply the contents of the file by 2, and save the result in the same file. Your program will run this process num times.

Example:

User enters the number 3.

program opens file, file contains the number 1, it is multiplied by 2, saves the number 2 to file.

program opens file, file contains the number 2, it is multiplied by 2, saves the number 4 to file.

program opens file, file contains the number 4, it is multiplied by 2, saves the number 8 to file.

Program loop ends and it exits program *file should have the number 8 in it at this point, check to see if it is working correctly.. If I run the program again, it should continue from number 8, so if you keep running the program it should start making the number much bigger.*

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

Step: 3

blur-text-image

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

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions