0

Need Solution forC# 25.02

Hello, does anybody knows the Solution for that Discount system? :( i can‘t get it

21st Apr 2021, 4:17 AM
Stephan Lohß
Stephan Lohß - avatar
7 Antworten
+ 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!
21st Apr 2021, 4:32 AM
Sharique Khan
Sharique Khan - avatar
+ 1
No i didn‘t
21st Apr 2021, 8:14 PM
Stephan Lohß
Stephan Lohß - avatar
0
Share the question too
21st Apr 2021, 5:07 AM
Atul [Inactive]
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.
21st Apr 2021, 4:01 PM
Stephan Lohß
Stephan Lohß - avatar
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 } } }
21st Apr 2021, 4:01 PM
Stephan Lohß
Stephan Lohß - avatar
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?
21st Apr 2021, 4:02 PM
Stephan Lohß
Stephan Lohß - avatar
0
Have you got your answer?
21st Apr 2021, 4:15 PM
Atul [Inactive]