Results 1 to 4 of 4
  1. #1

    Smile C# training(share ideas)


    C# Training – Control Statements Part II


    1. A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and "time-and-a-half"1.5 times their hourly wage for overtime hours worked), commission workers (who receive $250 plus 5.7 percent of their gross weekly sales), or pieceworkers (who receive a fixed amount of money per item for each of the items they produce each pieceworker in this company works on only one type of item). Write a program to compute the weekly pay for each employee. You do not know the number of employees in advance. Each type of employee has its own pay code: Managers have code 1, hourly workers have code 2, commission workers have code 3 and pieceworkers have code 4. Use a switch to compute each employee's pay according to that employee's pay code. Within the switch, prompt the user (i.e., the payroll clerk) to enter the appropriate facts your program needs to calculate each employee's pay according to that employee's pay code.

      C# Training – Introduction to Function and Recursion


      1. (PrimeNumbers) An integer is said to be prime if it is divisible by only 1 and itself. For example, 2, 3, 5 and 7 are prime, but 4, 6, 8 and 9 are not.


        1. Write a function that determines whether a number is prime.


        1. Use this function in a program that determines all the prime numbers between 1 and 1000. Store the results in an array and print them in a neat table format.




      1. Write a recursive function power ( base, exponent ) that, when invoked, returns


      base exponent


      For example, power( 3, 4 ) = 3 * 3 * 3 * 3. Assume that exponent is an integer greater than or equal to 1. Hint: The recursion step would use the relationship


      base exponent = base • base exponent – 1


      and the terminating condition occurs when exponent is equal to 1, because


      base1 = base


      C# Training – Introduction to Classes and Objects


      1. Create a class called Account that a bank might use to represent customers' bank accounts.
        1. Your class should include one data member of type int to represent the account balance. [Note: In subsequent chapters, we'll use numbers that contain decimal points (e.g., 2.75) called floating-point values to represent dollar amounts.]


        1. Your class should provide a constructor that receives an initial balance and uses it to initialize the data member. The constructor should validate the initial balance to ensure that it is greater than or equal to 0. If not, the balance should be set to 0 and the constructor should display an error message, indicating that the initial balance was invalid.


        1. The class should provide three member functions. Member function credit should add an amount to the current balance. Member function debit should withdraw money from the Account and should ensure that the debit amount does not exceed the Account's balance. If it does, the balance should be left unchanged and the function should print a message indicating "Debit amount exceeded account balance." Member function getBalance should return the current balance. Create a program that creates two Account objects and tests the member functions of class Account.


  2. #2
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    WOw class design , hope you already familiar with class, if you want to implement that in more advance way, study Interface and abstract.

    Class will do....


    so how will you constrcut your class base on that problem?

  3. #3
    Quote Originally Posted by MarkCuering View Post
    WOw class design , hope you already familiar with class, if you want to implement that in more advance way, study Interface and abstract.

    Class will do....


    so how will you constrcut your class base on that problem?

    Sir MArk Bag-o paman ko ani nga C# gud. Thats why nag sige ko u search about C#.
    first meet namo sa klase gitigaan dayun me ug exercises about c#.
    Need ure help or idea sir! Thats why nagpost ko diri ug topic para at least naa sad ko idea.

    Sir unsaon diay pag split ang value sample mo input ta ug 43321 ya ang output sir kay 4 3 3 2 1 nana siya space ba.
    sorry sir ha!

  4. #4
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    kung string you can use something like this:

    s = s.Insert(index, " ");


    but I suggest you to convert string input into array of integer.

    ex.

    public static int[] ArrayOfInteger(string s)
    {
    int SIZE = s.Length;
    int[] arrayOfInteger = new int[SIZE];

    for (int x = 0; x < s.Length; x++)
    {
    arrayOfInteger[x] = Convert.ToInt32(s.Substring(x, 1));
    }
    return arrayOfInteger;
    }

  5.    Advertisement

Similar Threads

 
  1. Replies: 23
    Last Post: 08-29-2010, 02:21 AM
  2. C902 user review pls share idea
    By danilo69 in forum Gizmos & Gadgets (Old)
    Replies: 1
    Last Post: 12-30-2009, 05:00 PM
  3. why uban cellphone unit naay NTC sticker, and uban pud Wala. Pls Share iDea
    By barbiegurl69 in forum Gizmos & Gadgets (Old)
    Replies: 9
    Last Post: 12-28-2009, 11:47 PM
  4. GADGET SHOP - share ideas how to start it.
    By gpcortes07 in forum Business, Finance & Economics Discussions
    Replies: 5
    Last Post: 04-08-2009, 07:21 PM
  5. 6630 owners share ideas
    By benj04 in forum Gizmos & Gadgets (Old)
    Replies: 2
    Last Post: 02-12-2007, 09:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top