Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Rextester.Program.Main is the entry point for your code. Don't change it.
- //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace Rextester
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- //Your code goes here
- Console.WriteLine("Hello, world!");
- int numberOfItems = 8;
- discount(numberOfItems);
- }
- public static void discount(int q) {
- if (q < 10) {
- printDiscount(5);
- } else if (q < 50) {
- printDiscount(10);
- } else if (q < 100) {
- printDiscount(15);
- } else {
- printDiscount(20);
- }
- }
- public static void printDiscount(int dis) {
- Console.WriteLine("Your discount will be {0}%", dis);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement