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
If it can be applied, the least-damaging recovery option is ________.
Fed [463]
The answer is D, I believe.

6 0
3 years ago
How many free passes do you get for skipping videos and getting answers
blondinia [14]

Answer:

I think it is 1 because that is all that works for me

3 0
1 year ago
Which of the following protects against cave-ins? A. All answer choices protect against cave-ins B. Shielding C. Shoring D. Slop
babunello [35]
I think it is b idk if it is 100% right
4 0
2 years ago
Read 2 more answers
Which is the best video games​
Travka [436]

Answer:

overwatch and dead by daylight

5 0
2 years ago
Read 2 more answers
Match each option to the description of the task it accomplishes.
muminat

Answer:

Follows are the solution to the given question:

Explanation:

Please find the attached file of the matching.

Arrange: In shape formatting, the "arrange" is used to provide an arrangement in the positing of the shape on the given slide.

shape styles: In shape formatting, it is used for applying a new design to the shape.

size: In shape formatting, the size is used for modifying the shape.

insert shapes: In shape formatting, the insert shape is used to add a new shape.

Wordart styles: In shape formatting, Wordart is used to provide a text design on the shape.

5 0
3 years ago
Other questions:
  • True or false. Every word has only one correct spelling and pronunciation.
    6·1 answer
  • What is the term used to describe data sets are so large and complex that they become difficult to process using traditional dat
    12·1 answer
  • A mobile device has stopped receiving automatic OS updates that until recently were pushed to the device.
    7·2 answers
  • How can i become an expert in computer and technology?
    15·2 answers
  • When a diaphragm contracts, a person is<br>Exhaling<br>Inhaling​
    12·2 answers
  • Write an application that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If th
    5·1 answer
  • What are the OSHA construction standards also called ?
    10·1 answer
  • EASY POINTS who is your favorite in family<br> 1. mom<br> 2. dad<br> 3. sister<br> 4. brother
    10·2 answers
  • Work-based learning can be defined as educational experiences that focus on
    6·1 answer
  • Fifteen years ago, everyone didn't have a cell phone. Anyone developing an app would not have found many users. Today, the exist
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!