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
Carlie was asked to review a software project for her company to determine specific deadlines. Which part of project management
Elis [28]

Answer:

Resources

Explanation:

Carlie certainly requires to review the resources. It is important to find out how many software engineers, testers, etc. are available. And only then Carlie can find out the exact deadlines as required here. And hence, she must have look at the resources while determining the specific deadlines. Hence, resources are the correct option.

3 0
3 years ago
Read 2 more answers
In the Dognition_aggregated_by_DogID data set, what is consistent about the relationship between breeding group and number of te
snow_tiger [21]

Answer:

Toy dogs

Explanation:

Tableau is an application used for statistically analyzing and visualizing data. It is very popular for its ecstatic data visualization figures and works with all dataset types to create a tableau data format.

The Dognition_aggregated_by_DogID dataset holds data for the different dog types, breeding, and tests done on them. The consistent relation between the breeding group column and tests completed is the toy dogs.

3 0
3 years ago
• what command-line utility can you use to assign the correct dns server ip address
Lilit [14]
On A Windows machine, you can use the netsh command.
<span>netsh interface ip set dns name="Local Area Connection" static 208.67.222.222

All the steps below means you have access to the router via Telnet or physical access  and it already has a valid configuration (except the DNS)
On a Cisco Router is:
</span><span>Step 1:  <span>enable 
</span></span><span>Step 2: <span>configure <span>terminal 
</span></span></span><span>Step 3: <span>Do one of the following: <span><span>ip domain name name
                                                       </span><span><span>ip domain list </span><span>name
</span></span></span></span></span><span>Step 4 : Device(config)# ip name-server 172.16.1.111 172.16.1.2</span>
5 0
3 years ago
1. Select the Volatile Memory *
fomenos

Answer:

1 no.

ram

2

harmful software to the computer

3

local area network

4

bit

5

ram

6

morris malware

7

hard disk drive

8

read only memory9

gigabyte

hope this will help u

6 0
2 years ago
Write a program that initializes a string variable and prints the first three characters, followed by three periods, and then th
d1i1m1o1n [39]

firstly we have to initialize the variable, means to give variable a value and then print the statement

string = "fahadisahadam"

print(string[:3]+"..."+string[-3:])

string is a data type that contains two or more characters.

means the string is fahadisahadam so the print will print first three characters. follow by three periods(...) and then last three characters.

The output will be:

fah...dam

8 0
3 years ago
Other questions:
  • How to get an hdmi working from a chromebook?
    6·2 answers
  • Discuss how and why video game hardware affects game design and where you think the next generation of platforms will change tho
    9·1 answer
  • Spreadshet formula to add totals​
    12·1 answer
  • Use the Web as a resource to study the PDF format. a. Describe how PDF provides output that is consistent across different types
    8·1 answer
  • What sugar is used in a DNA molecule​
    7·2 answers
  • What is the text that is entered into a cell used to identify the purpose of the worksheet, columns, and rows? a. date and time
    14·1 answer
  • Tcp takes a three-step approach to establishing a reliable communication. first, from the transport layer of the sending device
    12·1 answer
  • Technologies can offer safety and protection for people
    11·1 answer
  • How to write conclusion of hard disk​
    11·1 answer
  • A user reports that he cant browse to a specific website on the internet. From his computer, you find that a ping test to the We
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!