Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication12
- {
- class Program
- {
- static void Main(string[] args)
- {
- int total = 0, books, price;
- Console.WriteLine("Enter the book's price: ");
- price = int.Parse(Console.ReadLine());
- for (int i = 10; i > 0; i--)
- {
- Console.Write("Enter the amount of books you've purchased: ");
- books = int.Parse(Console.ReadLine());
- total = total + books;
- }
- Console.WriteLine("You've sold " + total + " books! Congratulations!");
- Console.WriteLine("You've earned " + (total * price) + "$");
- }
- }
- }
Add Comment
Please, Sign In to add comment