We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

Looking For Something at vustudents.ning.com? Click Here to Search

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

# Visual Programing (CS411) Assignment#01 Deadline Date = 18-11-2019

Please read all the instructions carefully before attempting the assignment.

You are required to create aC# application Consoleusing Visual Studio.

Problem Statement:

You will declare a new class name as “Student” then you will perform the Operator Overloading for following binary operators:

+ operator

*operator:

For this you will take

Second last digits and the last digit of your VU id as input.

For example, if your VU id is bc12345678 you will take 7 and 8.

You will write then following functions in class “student:

For + operator overloading1stfunction: concatenate last two digits

Example: Your id is BC12345678

1st function 7+8=78

For * operator overloading2ndfunction: take power of 2nd last digit the times last digit is

Example: your ID is BC12345678

2ndfunction 78=5,764,801

Note: Program must show your own VUID usage.

 Submission details Following Files Must be submitted in a single zip or rar file. ·         .C# code file (file name should be your VUID) ·         A .gif file which shows working of your Application (For Recording .gif a software named Screentogif is uploaded on LMS, or you can use any other gif recording tool as well) You are not required to submit the complete project, only copy these three files from project folder. Please note if you submit doc file you will be awarded 0 marks.

If you do not submit any of the above-mentioned file you will be awarded 0 Marks.

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

See Your Saved Posts Timeline

Views: 2187

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

Attachments:

### Replies to This Discussion

ye kese he

thanks for solution

//<>
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace cs411
{
//my student id is bc150401804
//last two digits of my student id are 0 and 4

public class Student
{

public int Number { get; set; }
public Student(int number)
{
Number = number;
}

public Student()
{

}

public static string operator +(Student left, Student right)
{
string result = left.Number.ToString() + right.Number.ToString();
return result;
}

public static long operator *(Student left, Student right)
{

int @base = left.Number;
int power = right.Number;

long result = 1;

for (int i = 1; i <= power; i++)
{
result*= @base;
}

return result;
}

}

class Program
{
static void Main(string[] args)
{

var leftStudent = new Student(number:0); //first number of last two digits
var rightStudent = new Student(number: 4); //second number of last two digits

var firstResult = leftStudent + rightStudent;
var secondResult = leftStudent * rightStudent;

Console.WriteLine("1st operator + overloading result is = " + firstResult);
Console.WriteLine("2nd operator * overloading result is = " + secondResult);

}
}
}

CS411_Assignmnet_1_Solution_Fall_2019_vustudents.ning.com

CS411_Assignmnet_1_Solution_Fall_2019_vustudents.ning.com

I've attached the solution file, rename the file and class to your roll number, change to your role number and input your last two digits and create a gif by running it in visual studio

Solution.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace cs411

{

//my student id is bs150402194

//last two digits of my student id are   9 and 4

public class Student

{

public int Number { get; set; }

public Student(int number)

{

Number = number;

}

public Student()

{

}

public static string operator +(Student left, Student right)

{

string result = left.Number.ToString() + right.Number.ToString();

return result;

}

public static long operator *(Student left, Student right)

{

int @base = left.Number;

int power = right.Number;

long result = 1;

for (int i = 1; i <= power; i++)

{

result*= @base;

}

return result;

}

}

class Program

{

static void Main(string[] args)

{

var leftStudent = new Student(number:9); //first number of last two digits

var rightStudent = new Student(number: 4); //second number of last two digits

var firstResult = leftStudent + rightStudent;

var secondResult = leftStudent * rightStudent;

Console.WriteLine("1st operator + overloading result is  = " + firstResult);

Console.WriteLine("2nd operator * overloading result is  = " + secondResult);

}

}

}

The correct Solution is attached below - hurry up and create ur gifs by updating ur Id's last 2 digits here - Student std = new Student(7, 8); (1 assumed 7 & 8 to be last 2 digits)

Attachments:

Naser Javed (BBIT-6) Please upload the file according to the below screen shot .thanks File attached is not download properly.

OMG Tariq Bhai!!... Mein ny abhii group check kiya :X :'(

CS411Code.doc

## Latest Activity

2 minutes ago

4 minutes ago
13 minutes ago
17 minutes ago
18 minutes ago
Rana Ali posted a discussion

### Ek Shakhs Ko Dekha Tha Taroon Ki Tarah Hum Ne

18 minutes ago
20 minutes ago
Rana Ali liked Rana Ali's discussion تمہیں دل لگی بھول جانی پڑے گی
22 minutes ago
Esha mirza liked Jabra's discussion Mere Sth Aysa howA hai ap k Sth??
23 minutes ago
Esha mirza liked +¢αяєℓєѕѕ gιяℓ's discussion Galat fehmi..
23 minutes ago
24 minutes ago
Esha mirza liked Asad's discussion مایوسی
24 minutes ago

1

2

3