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
Karo-lina-s [1.5K]
3 years ago
9

Write a class named Add that has the following data members, constructor, and methods:

Computers and Technology
1 answer:
taurus [48]3 years ago
7 0

Answer:

A class is like a blueprint of object.

Explanation:

A class defines the kinds of data and the functionality their objects will have.

A class enables you to create your own custom types by grouping together variables of other types, methods and events.

In C#, we can create a class  using the class keyword.

Here's a sample program:

using System;

namespace ConsoleApplication

{

   public class Test

   {

       public static void Main()

       {

           Add a1 = new Add(70, 50);

           a1.AddNumbers();                    

           Console.ReadLine();

       }      

   }

     class Add

   {

       private int row;

       private int column;

       public Add(int r, int c)

       {

           row = r;

           column = c;

       }

       public void AddNumbers()

       {

           Console.WriteLine(row+column);

       }

   }

}

output: 120

Explanation of the program:

I have created a class named Add. Within a class, row and column are two fields and AddNumbers() is a method. We also have constructor to initialize row and column.

In main method, If I need to invoke members of the class, I must create  an instance of the class. We can create any number of instances using the single class.IN our program, a1 is the reference variable using which we can invoke members of the class. I invoked function in the class and passed arguments to the constructor while creating an instance.

Those values are assigned to method variables and it operated the addition. Thus the output is 120.

You might be interested in
2. Because technology is always changing, there are new applications being developed constantly. (1 point)
Zepler [3.9K]
True because we need new tech
4 0
3 years ago
Read 2 more answers
Which one of the following items would you be most likely to keep in a database ?
DerKrebs [107]
C.) Payroll records. These are the most extensive and data-intensive.
8 0
3 years ago
What is the purpose of the SMTP command "HELO"
sergij07 [2.7K]
If a client initiates the SMTP communication using an EHLO (Extended Hello) command instead of the HELO command some additional SMTP commands are often available. They are often referred to as Extended SMTP (ESMTP) commands or SMTP service extensions. Every server can have its own set of extended SMTP commands.
4 0
3 years ago
25 Points!
neonofarm [45]

Answer:

I believe the answer is D. var = var + 1

Explanation:

5 0
2 years ago
Managers can use __ software to discuss financial performance with the help of slides and charts
Natali5045456 [20]

Answer:

presentation

Explanation:

Software like Google Slides and Microsoft Powerpoint can be utilized to present financial performances through the use of slides and charts.

6 0
2 years ago
Other questions:
  • I need someone to transfer this into a database in excel Please help :D 7 pts
    15·1 answer
  • A pair of single quotes ' will prevent the shell from interpreting any special character. True or False
    15·1 answer
  • 8.5 question 2 edhesive
    11·1 answer
  • What are MIDI signals?
    12·1 answer
  • Second Largest, Second Smallest Write a program second.cpp that takes in a sequence of integers, and prints the second largest n
    15·1 answer
  • A computer has dose not have ___________
    6·2 answers
  • 1.erros can easily be ____ 2.work is done in an ____ no mess environment 3.colors do not _____ and brushes are never ______ 4.st
    14·1 answer
  • * what is an electronic mail ?
    13·1 answer
  • I am having trouble with this python question. I am in a beginner level class also so any solution that isn't too complex would
    8·1 answer
  • In cell N2, enter a formula using the IF function and structured references as follows to determine which work tier Kay Colbert
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!