Hello again, again i just want to verify that i did my homework right

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

namespace Movie
{
    class Program
    {
        static void Main(string[] args)
        {
           
                    MovieData();
        }

        public static void MovieData(string movie = "The Social Network", int minute = 90)
            {
                Console.Write("The movie "+""+ movie.ToString()+ " is " + minute.ToString()+ " long\n\n");
            }
    }
}

Recommended Answers

All 4 Replies

It only asks for one default argument, and wants you to call the method twice in your main code, once with just a movie name and once with a name and minutes.

how would you do it?

static void Main() {
    MovieData("The Social Network");
    MovieData("Jaws", 121);
}

static void MovieData(String movieName, int runTime = 90) {
    Console.WriteLine("The movie {0} is {1} minutes long", movieName, runTime);
}

Thanks i was about to submit the same thing i just figures it out

if i can ask you another Question how do you display an array of numbers in Gui app

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.