@CycleWeeb/

catgenerator

C#

No description

fork
loading
Files
  • main.cs
  • main.exe
main.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
29
30
31
32
33
34
35
36
37
38
39
using System;

class Cat {
  string name;
  double height;
  double weight;
  int age;

  public Cat(string name, double height, double weight, int age){
    this.name = name;
    this.height = height;
    this.weight = weight;
    this.age = age;
  }

  public string getName(){
    return name;
  }

  public double getWeight(){
    return weight;
  }

  public double getHeight(){
    return height;
  }

  public int getAge(){
    return age;
  }

  public string toString(){
    return ("I am a cat named " + this.getName() + " and I weigh " + this.getWeight() + "lbs, and I am " + this.getHeight() + " cm, and I am " + this.getAge() + " years old.");
  }
  public static void Main (string[] args) {
    Cat e = new Cat(Console.ReadLine(), 24.3, 30.1, 4);
    Console.WriteLine(e.toString());
  }
}