Create the following form using C# Create a form ,name this new form: Loops Name all your objects clearly as in : i. txtLaptopCurrentPrice ii. txtDesiredPrice iii. lstAnswer b. and likewise the corresponding variables that have the data type of the variable and matching the text box name as in: i. dblLaptopCurrentPrice = 0; ii. dblDesired Price = 0: iii. intCounter = 0; iv. dblTotal = 0; v. const dblYearlyDeduction = .10 7.The price of laptops is expected to go down by 10% per year. Use a while loop to display the year and price when the price will be under a specified target amount. Allow the user to specify the current price and the target price using TextBoxes .using a loop the number of years it will take for the Laptop to be less than or equal to your desired price. a. You should clear the list box as the first line of code (before while) in the calculation area as in : lstAnswer.Items.Clear() b. Also set before the while statement dblTotal to be the current price c. The formula (to help you get started in the while) i. dblTotal = dblTotal * (1 - dblYearlyDeduction) d. Your list box should show (if you start with 1000) i. Year 0: $1000.00 ii. Year 1: $900.00 iii. Year 2: $810.00 (continue until you hit your target price)
Create the following form using C#
Create a form ,name this new form: Loops
Name all your objects clearly as in :
i. txtLaptopCurrentPrice
ii. txtDesiredPrice
iii. lstAnswer
b. and likewise the corresponding variables that have the data type of the variable
and matching the text box name as in:
i. dblLaptopCurrentPrice = 0;
ii. dblDesired Price = 0:
iii. intCounter = 0;
iv. dblTotal = 0;
v. const dblYearlyDeduction = .10
7.The price of laptops is expected to go down by 10% per year. Use a while loop to display the year and price when the price will be under a specified target amount. Allow the user to specify the current price and the target price using TextBoxes .using a loop the number of years it will take for the Laptop to be less than or equal to your desired price.
a. You should clear the list box as the first line of code (before while) in the
calculation area as in : lstAnswer.Items.Clear()
b. Also set before the while statement dblTotal to be the current price
c. The formula (to help you get started in the while)
i. dblTotal = dblTotal * (1 - dblYearlyDeduction)
d. Your list box should show (if you start with 1000)
i. Year 0: $1000.00
ii. Year 1: $900.00
iii. Year 2: $810.00 (continue until you hit your target price)
8. Develop a form that allows the user to project the population of your city for a specified number of years and growth rate. Allow the user to specify the current year’s population, the number of years and the annual growth rate. Use a for loop to compute and display each year, starting with the current year and the corresponding population.
a. Follow the same process as in #7 above.
b. To help you, the formula would be to ADD versus SUBTRACT as in:
i. dblTotal = dblTotal + (dblTotal * desiredGrowthRate)
ii. Sample list box output would be (don’t forget to clear)
1. Year 0: - 10,000
2. Year 1: - 10,500 (if the growth is 5%) etc.
9.Develop a form to display the Fahrenheit temperature and corresponding Celsius temperature for Fahrenheit temperatures ranging from –40 to +40 degrees, at increments of 10. Use a for loop. The conversion formula is
- Celsius = (Fahrenheit - 32) * 5/9
a. Sample output in the list box (don’t forget to clear)
i. F: -40; C: -40
ii. F: -30, C: -34.4
iii. F: -20, C: -28.9
iv. Continue..
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images