Pract Qns
Pract Qns
Pract Qns
Write a Visual Basic application that converts a Celsius temperature to its Fahrenheit
equivalent. The Iormula is:
Make the Celsius temperature a named constant so that its value can be changed
easily. The program should print both the value oI the Celsius temperature and its
Fahrenheit equivalent, with appropriate identiIying messages. Display the output in a
single label. Be sure to include appropriate comments in your program, choose
meaningIul identiIiers, and use indentation as we do in the programs in this chapter.
1. Write a Visual Basic application that calculates and prints the diameter, the
circumIerence, or the area oI a circle, given the radius. The application should have
three buttons, one Ior diameter, one Ior circumIerence, and one Ior area. The user
should be prompted to enter the radius in Iloating-point Iorm and press the
appropriate button. The output should be labeled appropriately. For example, iI the
input is 6.75 and the area button is pressed, your program should print something like
this:
The area of a circle with radius 6.75 is 143.14
ere are the Iormulas you need:
2
2
2
Diameter r
Circumference r
r
6
6
where r is the radius. Use 3.14159265 Ior a.
ueslgn and code a vlsual 8aslc appllcaLlon Lo read an lnvolce number quanLlLy ordered and unlL
prlce (all lnLegers) and compuLe Lhe LoLal prlce 1he appllcaLlon should wrlLe ouL Lhe lnvolce number
quanLlLy unlL prlce and LoLal prlce on Lhe screen wlLh ldenLlfylng phrases lormaL your program
wlLh conslsLenL lndenLaLlon use approprlaLe commenLs and meanlngful ldenLlflers 1he daLa ls
prompLed for and read from Lhe screen use buLLons where approprlaLe
1. ou have bought a car, taking out a loan with an annual interest rate oI 9. ou
expect to make 36 monthly payments oI $165.25 each. ou want to keep track oI the
remaining balance you owe aIter each monthly payment. The Iormula Ior the
remaining balance is:
1 (1 )
n
i
Bal pmt
i
where
o Bal