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
When is an original work considered Public Domain? A. When posted via social media. B. When is it posted on the internet C. When
I am Lyosha [343]
<span>Best Answer is (D)
</span>

Any<span> materials not protected by copyright, patent laws or trademark are referred to as copyright. Generally, the public owns these works, and anyone is allowed to use public domain works without obtaining permission. There are various common ways that these works may end up arriving in the public domain. One of those ways includes the expiration of copyright. The copyright owner may also fail to follow renewal rules that govern copyright. </span>The copyright owner may as well decide to place his or her works deliberately in the public <span>domain.</span>

3 0
4 years ago
Which type of polish grade uses green-colored connectors to help you keep from using the wrong connector type
Anestetic [448]

Answer:

Medium Grade Liquid Metal Polish. pls give me brainliest

8 0
2 years ago
Technician A says that the purpose of the electrolyte is to allow the escape of hydrogen gas from the battery. Technician B says
kifflom [539]

Answer:

D. Neither Technician A nor B.

Explanation:

D. Neither Technician A nor B.

The electrolyte is a chemical medium that allows the flow of electrical charge between the cathode and anode. When a device is connected to a battery — a light bulb or an electric circuit — chemical reactions occur on the electrodes that create a flow of electrical energy to the device.  

7 0
3 years ago
What is a computer?​
Oksanka [162]

Answer:

Hi myself Shrushtee. And l have given your answer in Hindi and English language.

Explanation:

an electronic machine that can store, find and arrange information, calculate amounts and control other machines

जानकारी संचित करने, ढूँढ़ने व व्‍यवस्थित करने, परिकलन करने व अन्‍य मशीनों पर नियंत्रण रख पाने वाली एक इलेक्‍ट्रॉनिक मशीन; कंप्‍यूटर

please mark me as brainleist

5 0
3 years ago
What can be used to visually represent information similar to a diagram
Assoli18 [71]
A vin diagram should help you lay it out

5 0
3 years ago
Other questions:
  • In 2-5 paragraphs, describe the points that Kendra needs to consider when choosing a telecommunications technology to meet her n
    6·1 answer
  • Automotive engine cylinder heads can be made of what?
    7·1 answer
  • Brenda's working on improving a Google Search Ads quality score so it potentially gets a better ad rank and performs better in t
    9·1 answer
  • TIFF is the default file format for most digital cameras. State True or False.
    13·1 answer
  • Write a function called lucky_sevens that takes in one #parameter, a string variable named a_string. Your function #should retur
    15·1 answer
  • What do we call the distribution and access of illegal copies of digital books??
    9·2 answers
  • Assume that a 5 element array of type string named boroughs has been declared and initialized. Write the code necessary to switc
    5·1 answer
  • In what type of attack does the attacker have the ciphertext of several messages that were encrypted with the same encryption al
    14·1 answer
  • Explain how mobile phone production could be more sustainable​
    8·2 answers
  • How many hours do you spend on the Internet per day?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!