Question: Write a Junit test and use the test cases. import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String args[])

Write a Junit test and use the test cases.

import java.util.*; import java.lang.*; import java.io.*;

public class Main {

public static void main (String args[]) { // M = Money Spent // S = Shopping Sessions // R = Registred int M, S; boolean R ; Boolean card; int discount; Scanner sc = new Scanner (System.in); M = sc.nextInt (); S = sc.nextInt(); R = sc.nextBoolean(); if (M>1000 && S>=20 && R == true) { discount = 10 ; card = true ; } else if (M>1000 && S<20 && r == true) { discount = 5 ; card = true } else if (m>1000 || S>=20 && R == true) { discount = 0 ; card = true ; } else { discount = 0 ; card = false ; } System.out.println(" You have discount of "+discount+"%"); System.out.println(" Card Statut: "+ card); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!