Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class CD {
- private string artist;
- private string title;
- private string genre;
- private int releaseYear;
- private string recordLabel;
- private int nrSongs;
- private double totalTime;
- public CD() { //Konstruktor utan några paramterar
- }
- public CD (string artist, string title) { //Konstruktor med två parametrar
- artist = artist;
- title = title;
- }
- public CD (string artist, string title, string genre, int releaseYear,
- string recordLabel, int nrSongs, double totalTime) { //Konstruktor med alla parametrar
- artist = artist;
- title = title;
- genre = genre;
- releaseYear = releaseYear;
- recordLabel = recordLabel;
- nrSongs = nrSongs;
- totalTime = totalTime;
- }
- CD(string String, string String0, string String1, int i, int i0, double d) {
- //Skapar getters och setters för alla parametrar
- }
- public String Artist {
- get { return artist; }
- set { artist = value; }
- }
- public String Title
- {
- get { return title; }
- set { titel = value; }
- }
- public string Genre() {
- get { return genre; }
- set { genre = value; }
- }
- public int ReleaseYear() {
- get { return releaseYear; }
- set { releaseYear = value; }
- }
- public string RecordLabel() {
- get { return recordLabel; }
- set { recordLabel = value; }
- }
- public int NrSongs() {
- get { return nrSongs; }
- set { nrSongs = value; }
- }
- public double TotalTime() {
- get { return totalTime; }
- set { totalTime = value; }
- }
- public void printBrief() {
- Console.WriteLine(artist + " - " + title + " , " + releaseYear );
- }
- public void printFull() {
- Console.WriteLine(artist + " - " + title + " , " + genre +
- " , " + recordLabel + " , " + releaseYear + " , " +
- nrSongs + " låtar, speltid: " + totalTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement