Please help me in solving this question

Task 1. Create a class to store details of student, such as rollno, name, course joined, and fee paid so far. Assume courses are C# and ASP.NET with course fees being 2000 and 3000, respectively. (3 marks)
  1. Provide a constructor that takes rollno, name and course.
  2. Provide the following methods:

    1. Payment(amount)

                    feepaid += amount; 
      
    2. Print() : {to print rollno, name, course and feepaid}

    3. Due amount if the student pays only 1000 as a first payment.

                  TotalFee -= feepaid 
      
  3. Declare an object S and call the above methods using

    Student s = new Student(1, "John", "c#");

Task 2- Complete the program below by adding class customer that uses overloaded constructors:

A. Customer(string firstName, string lastName)

B. public Customer(string firstName)

using System; 

namespace CustomerApp 

{ 

    public class Customer 

    { 

        // here you need to add class members (instance variables, constructors and methods) 

     } 

} 



Here the program where you test the Customer class. 

 using System; 

 namespace CustomerApp 

{ 

    class Program 

    { 

        static void Main(string[] args) 

        { 

            Customer customer1 = new Customer("Joe", "Black"); 

            Customer customer2 = new Customer("Jim"); 

             Console.WriteLine("{0} {1}", customer1.FirstName, customer1.LastName); 

            Console.WriteLine("{0} {1}", customer2.FirstName, customer2.LastName); 

            Console.ReadLine(); 

        } 

    } 

}

School stuff, right?
We should not suppose to do the code instead of you, you know.
You do have some code, so what parts you do NOT understand, from what you have to do from your 1st task?
And please, do not post more then ONE issue at a time.

No answer...
Anyway, I`m a good person, and I like to help, that`s why I did your 1st homework.
TAKE A SLOW LOOK through the code, and try to learn how its done.
Here`s the code:

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

namespace Mar01_2
{
    class Program
    {
        static void Main(string[] args)
        {
            Student s = new Student(1, "John", "C#");
            //calling methods:
            int feePaid = s.Payment(900);
            //checking is th course was paid in total
            s.DueAmount(); 
            //printing:
            Console.WriteLine(s.Print());
            Console.WriteLine(s.Print2());
            Console.ReadLine();
        }
    }

    class Student
    {
        public int RollNumber { get; set; }
        public string StudentName { get; set; }
        public string CourseName { get; set; }
        public int FeePaid { get; set; }
        public int TotalFee { get; private set; }

        public Student(int rollNo, string name, string course)
        {
            this.RollNumber = rollNo;
            this.StudentName = name;
            this.CourseName = course;

            if (CourseName == "C#")
                TotalFee = 2000;
            else if (CourseName == "ASP.NET")
                TotalFee = 3000;
        }

        public int Payment(int amount)
        {
            return FeePaid += amount;
        }

        public string Print()
        {
            return string.Format("Roll number: {0}\r\nName: {1}\r\nCourse: {2}\r\nFee paid: {3}.",
                RollNumber, StudentName, CourseName, FeePaid);
        }

        //added by my self (its important):
        public string Print2()
        {
            if (TotalFee > 0)
                return string.Format("Course fee was not paid it total. Its still missing {0} out of {1}.",
                    TotalFee, TotalFee+FeePaid);
            else
                return string.Format("Course is paid it total.");
        }

        public void DueAmount()
        {
            TotalFee -= FeePaid;
        }
    }
}

And 2nd task`s code:

using System; 

namespace CustomerApp 
{
   public class Customer 
   { 
       public string FirstName { get; set; }
       public string LastName { get; set; }
       
       public Customer(stirng _first, string _last)
       {
           this.FirstName = _first;
           this.LastName = _last;
       }

       public Customer(string _first)
       {
           this.FirstName = _first;
       }
   }
}

There is no methods needed in this task, at least none is called in WriteLine() method, only properties are called.

You can vote +1 and mark as answered.
Best regards.

thanks for you

@m1412 do not just copy code readand understand the code first.Line 10 of Mitja's previous code contains the word stirng, this should be string!
He does this all the time to see if those who just copy stay alert:D

lol, its a glitch in the code.
I wrote the code by heart (this is what I do all the time), I actually dont use VS any longer :)

Thank you very much
The next time will write the solution in order to correct

You can vote +1 and mark as answered.
Best regards.

?

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.