
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
ASSIGNMENT FOR APP PROGRAMMING
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

1 | P a g e
BIT 2323 Application Programming II ~ Assignment I Requirement : a). The work should be done in groups b). No handwritten work will be accepted
Questions
1). A program is required for a computer game. The user keys in the number of rounds he wishes to play. For each round the user enters his lucky number. The program takes the number and divides it with a secret number. If the remainder of the division is zero, it is considered a draw for the round and the total score is incriminated by 1. Otherwise if it is any other even number, it is considered a win for the round and the total score is incremented by 3. However if it is an odd number, it is considered a loss for the round and the total score is decremented by 3. This is done until he completes his rounds. He wins if the total score at the end is a positive number. Write a C# program to accomplish this.
2). Using nested loops, write a C# application program that produces the following output.
& & & & & &
3). Write C# application program to be used to evaluate the credit worthy of a client. The program reads the credit limit and the price and quantity of the item to be purchased by the client. If the value of the goods is more than the credit limit, the program displays “Sorry you cannot purchase goods worthy such a value on credit” and allows the customer to re-enter the quantity, otherwise, displays “Thank You for purchasing from us” and the value of the purchase. This should be repeated for n customers.
4). Write a complete C# application program to calculate the area of a triangle, rectangle or circle. The program should have a decision making statement(s) to decide: If the figure is a triangle then ask for base and height values to input. If the figure is a rectangle the ask for length and breath values to input If the figure is a circle then ask for the radius values to input The program should display the output on the screen and should enable the user to re-enter choice for at most three times incase a wrong selection is entered
5). A company distributes 5 different items around Nairobi through its 10 salesmen. Using arrays write a C# application program to input a salesman name and the corresponding sales made by each of the salesman for each of the item. The program should then output each of the salesman’s name, sales, total sales as well as grand total using the format shown below.
**Name Item1 Item2 Item3 Item3 Item4 Item5 TotalSales
Brian 20 50 25 10 0 15 120 Joan 45 55 10 25 5 30 170 …. …. GrandTotal xx**