Results 1 to 10 of 10
  1. #1

    Smile C# Programming exercises(kinsay kahibawo ani C#.)


    C# Training – Introduction to C# Programming



    1. Write a program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. The screen dialog should appear as follows:

    Input the first integer: 3
    Input the first integer: 2
    Input the first integer: 10


    Sum is 15
    Average is 5
    Product is 60
    Smallest is 2
    Largest is 10





    1. Write a program that inputs a five-digit integer, separates the integer into its individual digits and prints the digits separated from one another by three spaces each. For example, if the user types in 42339, the program should print:

    4 2 3 3 9






    C# Training – Control Statements Part I



    1. A palindrome is a number or a text phrase that reads the same backwards as forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a program that reads in a five-digit integer and determines whether it is a palindrome. [Hint: Use the division and modulus operators to separate the number into its individual digits.]




    1. Write a program that reads in the size of the side of a square and then prints a hollow square of that size out of asterisks and blanks. Your program should work for squares of all side sizes between 1 and 20. For example, if your program reads a size of 5, it should print

    *****
    * *
    * *
    * *
    *****





    1. One large chemical company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9 percent of $5000, or a total of $650. Develop a C++ program that uses a while statement to input each salesperson's gross sales for last week and calculates and displays that salesperson's earnings. Process one salesperson's figures at a time.

    Enter sales in dollars (-1 to end): 5000.00
    Salary is: $650.00


    Enter sales in dollars (-1 to end): 6000.00
    Salary is: $740.00


    Enter sales in dollars (-1 to end): 7000.00
    Salary is: $830.00


    Enter sales in dollars (-1 to end): -1
    Last edited by reyarita; 12-04-2009 at 10:02 AM. Reason: unlock statement

  2. #2
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    Wow looks like an assignment nice to know that schools are teaching C#.

  3. #3
    Junior Member
    Join Date
    Jun 2009
    Gender
    Male
    Posts
    478
    Quote Originally Posted by MarkCuering View Post
    Wow looks like an assignment nice to know that schools are teaching C#.

    yes looks like an assignment. but interesting to see that it's called 'Training'. School doesnt use 'training' as word but 'course'.

  4. #4
    Quote Originally Posted by kamsky View Post
    yes looks like an assignment. but interesting to see that it's called 'Training'. School doesnt use 'training' as word but 'course'.

    Mga Sir naamoy mga idea!!

  5. #5
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    Quote Originally Posted by reyarita View Post
    A palindrome is a number or a text phrase that reads the same backwards as forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a program that reads in a five-digit integer and determines whether it is a palindrome. [Hint: Use the division and modulus operators to separate the number into its individual digits.

    - The question gives you already the right direction. you can use the modulus (%) operator to pick off each digit. determine that if it is in ten's hundred's, thousand's place.

    - Compare the first digit to last digit and if they're the same and if not directly output that it is not palindrome, and there is no way to be called as palindrome, when the first testing is already failed. continue comparing on 2nd and to the fourth, and so on...

    - ignore that middle digit. it can be any number.


    your teacher is using Dietel book for C#, you can have all the answers on the website, but I suggest you to have your own answer, post your code here and ask some guidance, or explanation.

  6. #6
    for this 2 just convert it to string and u can get each character trough their index
    1. Write a program that inputs a five-digit integer, separates the integer into its individual digits and prints the digits separated from one another by three spaces each. For example, if the user types in 42339, the program should print:

    4 2 3 3 9






    C# Training – Control Statements Part I


    1. A palindrome is a number or a text phrase that reads the same backwards as forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a program that reads in a five-digit integer and determines whether it is a palindrome. [Hint: Use the division and modulus operators to separate the number into its individual digits.]

    the other 2 is really a simple coding..pls try to do some of the code ur self then ask here if u have problems...dont expect that we would code everything for u cause that way u wont learn anything

  7. #7
    Osa man ne sa among training sauna pag solod nako sa among company...

  8. #8
    kini nga program..

    Make a calculator using C#.NET

    humana ko ani nga project...

  9. #9
    i already solve number 1 and 2.

  10. #10
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    can you show your code? people might give you some valuable advice.

  11.    Advertisement

Similar Threads

 
  1. what is your favorite programming language?
    By sachem in forum Programming
    Replies: 310
    Last Post: 10-08-2015, 03:11 PM
  2. Want To Buy: 1 year boxing exercise program membership in metrosports club....
    By Paolo1130 in forum Health & Beauty
    Replies: 0
    Last Post: 08-09-2012, 12:26 PM
  3. is there a right time to exercise?
    By shokoi in forum Fitness & Health
    Replies: 24
    Last Post: 03-29-2010, 09:04 PM
  4. Could there really be a faster, easier way to exercise?
    By Galadriel in forum Fitness & Health
    Replies: 36
    Last Post: 01-10-2010, 04:55 PM
  5. For Sale: Exercise-free, Weight Loss Program that works!
    By tradingpost9 in forum Health & Beauty
    Replies: 21
    Last Post: 05-05-2009, 08:44 AM

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