Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

1. What similarities do you have? Where do you disagree?

Answered: 1 week ago