0
Need Solution forC# 25.02
Hello, does anybody knows the Solution for that Discount system? :( i canât get it
7 RĂ©ponses
+ 1
You canât ask answers directly. Show your code and we will correct your code so you will understand your mistake and learn.
Happy Coding!
+ 1
No i didnât
0
Share the question too
0
A store is running a promotion: if the total purchase price is equal to or exceeds
10000, the price will be discounted by 20%.
The program you are given takes the total purchase price as input.
Complete the given method to take the total purchase price as an argument, and calculate and return the discounted price if campaign's requirement is satisfied.
The method should return the same price if discount is not given.
Sample Input
13000
Sample Output
10400
Explanation
13000>10000, so the discount should be given: 13000-(0.2*13000) = 10400.
Hint
You need to use if else statements inside the method.
Don't forget to mention the value type for the method parameter before its name.
Notice that method returns a value, so you need to use Console.Write()/Console.WriteLine() to execute the output.
0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
int totalPrice = Convert.ToInt32(Console.ReadLine());
//call the method
}
//complete the method declaration
static int Discount()
{
//complete the method body
}
}
}
0
Thank you. I think i don't get the point starting at:
Why is there first the call off the method an the declaration is following? Shouldn't be the declaration first and the call after?
0
Have you got your answer?