CS
cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by MattMad
using System;
using System.Collections.Generic;
namespace Code_Coach_Challenge
{
class Program
{
static void Main(string[] args)
{
string name1 = Console.ReadLine();
int points1 = Convert.ToInt32(Console.ReadLine());
string name2 = Console.ReadLine();
int points2 = Convert.ToInt32(Console.ReadLine());
DancerPoints dancer1 = new DancerPoints(name1, points1);
DancerPoints dancer2 = new DancerPoints(name2, points2);
// how to use the overloaded +
var result = dancer1 + dancer2;
Console.WriteLine($"{result.name}\n{result.points}");
}
}
class DancerPoints
{
public string name;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run