Answer:
Write the following in the button click event:
<em> double total = Convert.ToDouble(txtNonFood.Text) + Convert.ToDouble(txtFood.Text) * (1 + 0.07);
</em>
<em> MessageBox.Show("Total: " + total);</em>
Explanation:
The app is created using Winforms C#.
First, is to design the form using 2 labels, 2 textboxes and 1 button.
<em>The text of the labels are set to "Food Items" and "Non Food Items", respectively.</em>
<em>The name of the textboxes are set to txtFood and txtNonFood respectively.</em>
Next, is to ensure that the textboxes accept only numbers and 1 decimal point.
So, we need to create a keypress event:
<em>private void txtNonFood_KeyPress(object sender, KeyPressEventArgs e){</em>
<em />
And then, write the click event to display the total amount of items (as written in the answer section):
This calculates the total amount
<em> double total = Convert.ToDouble(txtNonFood.Text) + Convert.ToDouble(txtFood.Text) * (1 + 0.07);
</em>
<em>This prints the total amount</em>
<em> MessageBox.Show("Total: " + total);</em>
<em>See attachment 1 for app interface & attachments 2 and 3 for complete program code</em>