Selected Problems – CSC 102:) i need to your help

This is a discussion on Selected Problems – CSC 102:) i need to your help within the C# Programming forums, part of the General Programming Boards category; Selected Problems – CSC 102 on c# Selected Problems – CSC 102 Arrays: 1. Use a one-dimensional array to solve ...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Location
    in his heart
    Posts
    2

    Selected Problems – CSC 102:) i need to your help

    Selected Problems – CSC 102
    on c#





    Selected Problems – CSC 102
    Arrays:
    1. Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of $5000, or a total of $650. Write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount):
    a. $200299
    b. $300399
    c. $400499
    d. $500599
    e. $600699
    f. $700799
    g. $800899
    h. $900999
    i. $1000 and over


    2- Use a one-dimensional array to solve the following problem: Write an application that inputs five numbers, each of which is between 10 and 100, inclusive. As each number is read, display it only if it is not a duplicate of a number already read. Provide for the "worst case," in which all five numbers are different. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user inputs each new value.

    2. Write an application that uses a foreach statement to sum the double values passed by the command-line arguments. [Hint: Use static method ToDouble of class Convert to convert a string to a double value.]

    Methods:
    1. A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write an application that calculates and displays the parking charges for each customer who parked in the garage yesterday. You should enter the hours parked for each customer. The application should display the charge for the current customer and should calculate and display the running total of yesterday's receipts. The application should use method CalculateCharges to determine the charge for each customer.

    2. Write method Multiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The method should take two integer arguments and return true if the second is a multiple of the first and false otherwise. Incorporate this method into an application that inputs a series of pairs of integers (one pair at a time) and determines whether the second value in each pair is a multiple of the first.

    3. Write method IsEven that uses the remainder operator (%) to determine whether an integer is even. The method should take an integer argument, and return true if the integer is even and false otherwise. Incorporate this method into an application that inputs a sequence of integers (one at a time) and determines whether each is even or odd.

    4. What does the following method do?
    // Parameter b must be a positive
    // integer to prevent infinite recursion
    public int Mystery( int a, int b )
    {
    if ( b == 1 )
    return a;
    else
    return a + Mystery( a, b - 1 );
    }
    5. Find the error in the following recursive method, and explain how to correct it:
    public int Sum( int n )
    {
    if ( n == 0 )
    return 0;
    else
    return n + Sum( n );
    }
    Classes and objects:
    1. Create a class called Employee that includes three pieces of information as instance variablesa first name (type string), a last name (type string) and a monthly salary (decimal). Your class should have a constructor that initializes the three instance variables. Provide a property with a get and set accessor for each instance variable. If the monthly salary is negative, the set accessor should leave the instance variable unchanged. Write a test application named EmployeeTest that demonstrates class Employee's capabilities. Create two Employee objects and display each object's yearly salary. Then give each Employee a 10% raise and display each Employee's yearly salary again.

    2. Create a class called Date that includes three pieces of information as instance variablesa month (type int), a day (type int) and a year (type int). Your class should have a constructor that initializes the three instance variables and assumes that the values provided are correct. Provide a property with a get and set accessor for each instance variable. Provide a method DisplayDate that displays the month, day and year separated by forward slashes (/). Write a test application named DateTest that demonstrates class Date's capabilities.

    3. Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variablesa part number (type string), a part description (type string), a quantity of the item being purchased (type int) and a price per item (decimal). Your class should have a constructor that initializes the four instance variables. Provide a property with a get and set accessor for each instance variable. In addition, provide a method named GetInvoiceAmount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a decimal value. If the quantity is negative, it should be left unchanged. Similarly, if the price per item is negative, it should be left unchanged. Write a test application named InvoiceTest that demonstrates class Invoice's capabilities.












    please help me i have examination sat


    make me happy


    i am waiting


    our teacher don't have enough knowledge to explain

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    Check our Homework Policy.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,162
    Yeah, it's the teacher's fault. *rolls eyes*
    If you understand what you're doing, you're not learning anything.

  4. #4
    Registered User
    Join Date
    Mar 2009
    Location
    england
    Posts
    209
    These are all very basic questions you have to answer. Is it a case that you want someone else to do them? Or do you literally have no idea where to start?

    If the latter, then I would tend to agree that your teacher is not so great.

  5. #5
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    Quote Originally Posted by smilemark View Post
    our teacher don't have enough knowledge to explain
    Fair enough. Complain to your school administration. They'll do something about it. Oh, and good luck on your exam... if you actually can get of your lazy ass and go to class that day.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #6
    Registered User
    Join Date
    Mar 2011
    Location
    in his heart
    Posts
    2
    we write suggestion for our administration they did nothing for her


    ok

    thnx aloooooooooooooooot

    i am lazy ha



    be smile

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Some problems with selected short
    By thur0cker in forum C++ Programming
    Replies: 2
    Last Post: 03-13-2011, 01:51 PM
  2. Visual C++ 2010 express problems
    By dnj23 in forum Windows Programming
    Replies: 6
    Last Post: 08-10-2010, 06:16 AM
  3. Most Common problems in C
    By Bayint Naung in forum C Programming
    Replies: 18
    Last Post: 06-02-2010, 08:20 PM
  4. Arithmetic Problems using ProC
    By PaulB in forum C Programming
    Replies: 2
    Last Post: 10-10-2001, 02:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21