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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started