Answer:
We need to add four labels Taxable Income, Tax rate, total tax, and Total Due. And in front of them, you can add four textBoxes, or labels or as required.
The Tax rate is 5%.
And
Explanation:
BtnCalc_Click will calculate and display in lblTax
double tax = Convert.ToDouble((textBox1.Text)) * 5/100;
double Roundedtax = Math.Round(tax, 2);
textBox2.Text = Convert.ToString(Roundedtax);
textBox2.Show();
// we can use lblTax instead of textBox2. The further code will be almost change, and we need to use lblTax label instead of textBox2.Text.
BtnCalc_Click will calculate and display in lblTotal
textBox3.Text = Convert.ToString(Convert.ToDouble(textBox1.Text) + Convert.ToDouble(textBox2.Text));
textBox3.Show();
//This is lblTotal or the total Tax. We can use lblTotal label instead of the textBox3.Text.
BtnExit_Click will end the application:
Use this code in this method.
this.Close();
// This closes the application immediately on click on the Exit button.
Answer:
The answer to this question can be given as
The potential problem with the loop is it's counts when the user enters -1 from the keyboard, so the count will too many.
Explanation:
In the program there some line is missing. So the right program of the question can be given as:
import java.util.*; //import package for take input from user.
public class Main //define main class.
{
public static void main(String[] args)//define main function
{
Scanner scan=new Scanner(System.in); //creating object.
//print values.
System.out.print("Enter integers. Enter -1 to exit.");
System.out.println(" Count of integers entered will be returned.");
int n=0,c=0; //declaring integer variable.
while (n != -1) //loop
{
n = scan.nextInt(); //take input by user and hold on variable n.
c++;
}
System.out.println(c); //print value.
}
}
output:
Enter integers. Enter -1 to exit. Count of integers entered will be returned.
-1
1
1. Portable Monitors. ...
2. Smart Beds. ...
3. Wearable Devices. ...
4. Electronic Health Records. ...
5. Centralized Command Centers. ...
6. Telehealth and Apps.