1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ivenika [448]
3 years ago
14

An introduction to object-oriented programming.

Computers and Technology
1 answer:
Scorpion4ik [409]3 years ago
3 0

Answer:

The csharp program is given below.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace WindowsFormsApplication1

{

   public partial class Form1 : Form

   {

       public Form1()

       {

           InitializeComponent();

      }

       private void button6_Click(object sender, EventArgs e)

       {

           int total = (Convert.ToInt32(textBox1.Text) +  Convert.ToInt32(textBox2.Text) + Convert.ToInt32(textBox3.Text) + Convert.ToInt32(textBox4.Text) + Convert.ToInt32(textBox5.Text));

           int dozen = total / 12;

           int eggs = total % 12;

           textBox6.Text = dozen.ToString();

           textBox7.Text = eggs.ToString();

       }

       private void button7_Click(object sender, EventArgs e)

       {

           textBox1.Text = "";

           textBox2.Text = "";

           textBox3.Text = "";

           textBox4.Text = "";

           textBox5.Text = "";

           textBox6.Text = "";

           textBox7.Text = "";

       }

        private void button8_Click(object sender, EventArgs e)

       {

           Close();

       }

    }

}

Explanation:

1. The integer variables are declared for total eggs, number of dozens and number of eggs.

2. The input of each text box is converted into integer by using the Convert.ToInt32() method on the value of that particular text box.

3. All the inputs are added and the sum is assigned to variable, total.

4. The number of dozens are obtained by dividing total by 12 and assigning the value to the variable, dozen.

5. The number of extra eggs are obtained by taking the modulus of total and 12 and the value is assigned to the variable, eggs.

6. The integer values in the variables, dozen and eggs, are converted into string using the ToString() function with that particular value.

dozen.ToString();

eggs.ToString();

7. The text boxes are assigned the respective values of dozens and number of eggs.

textBox6.Text = dozen.ToString();

textBox7.Text = eggs.ToString();

8. Two additional buttons, clear and exit, are also added.

9. The clear button erases the contents of all the text boxes. The Text property of each textbox is set to “” thereby clearing all the text fields.

10. The exit button closes the application using Close() function.

11. The program is made in visual studio and the output is attached.

You might be interested in
How buffers are used when stream a video or a music from the internet to your computer.
jekas [21]

Answer:

Restart it.

Explanation:

8 0
3 years ago
FIRST TO Answer for free brainlest. GOG GOGOGO
oksano4ka [1.4K]

Answer:

ME

Explanation:

5 0
3 years ago
Choose the response that best completes the following statement.
slava [35]

Answer:

consider the outcome

Explanation:

7 0
3 years ago
Which of the following decimal (base-10) values is equivalent to the binary (base-2) value 101001?
garik1379 [7]

Answer:

D. 41

Explanation:

101001 is in base 2.

To convert 101001 to base 10;

1*2^5+0*2^4+1*2^3+0*2^2+0*2^1+1*2^0

1*32+0*16+1*8+0*4+0*2+1*1

32+0+8+0+0+1

=41

8 0
3 years ago
Timelines show
Aloiza [94]
A. the order of events...
hope this helps!
4 0
3 years ago
Read 2 more answers
Other questions:
  • What does this mean?
    7·2 answers
  • In which type of network will a problem with one computer crash the network?
    8·1 answer
  • You are the project manager tasked to implement a critical application in a reputed bank. A client review indicates that you cou
    6·1 answer
  • You are given two variables, already declared and assigned values, one of type double, named price, containing the price of an o
    7·1 answer
  • The printing press helped spread the ideas of the Renaissance.<br> a. True <br> b. False
    14·1 answer
  • Which type of cover letter would the above excerpt come from?
    7·1 answer
  • How do you invite someone to a conversation on brainly
    14·1 answer
  • 1.
    13·1 answer
  • The LCM of 4, 9, and 10 is _______.
    7·2 answers
  • Which type of measurement would you use to determine the mass of sugar?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!