Customer and Invoice Problem Solution in Java | Capgemini ADAPT 2022 Solution using Java
Customer and Invoice Problem Solution in Java | Capgemini ADAPT 2022 Solution using Java

In this post, you will get the solution to the Capgemini ADAPT 2022 solution to the problem of Customer and Invoice in Java. Capgemini ADAPT Java Solutions 2022, Customer and Invoice.

Note: The solutions are provided for learning purposes only. 

Customer and Invoice Problem Description:


A class called Customer, which models a customer in a transaction, is designed as shown in the class diagram. A class called Invoice, which models an invoice for a particular customer and composes an instance of Customer as its instance variable, is also shown. Write the Customer and Invoice classes.

Note: The Output should be displayed using printBill() method of invoice class.

The Invoice class should have printBill() to print the details of Invoice & Customer Object has shown in Sample Output 1:

Syntax

public void printBill()

Capgemini ADAPT 2022 – Customer and Invoice Problem Solution in Java:


 

import java.util.*;

public class Source{

public static void main(String[] args){

int id, dis, iid, dcost;

double fcost;

String s;

Scanner sc = new Scanner(System.in);

id = sc.nextInt();

s = sc.next();

dis = sc.nextInt();

iid = sc.nextInt();

cost = sc.nextInt();

dcost = (int)(cost*(dis/100.0f));

fcost = cost-dcost;

System.out.println(iid);

System.out.println(s);

System.out.println(dis);

System.out.println(fcost);

}

}

TOP COMPANIES HIRING DRIVE

BATCHWISE OFF-CAMPUS DRIVES

1. TCS OFF-CAMPUS DRIVES 1. 2018 BATCH
2. INFOSYS OFF-CAMPUS DRIVES 2. 2019 BATCH
3. COGNIZANT OFF-CAMPUS DRIVES 3. 2020 BATCH
4. WIPRO OFF-CAMPUS DRIVES 4. 2021 BATCH
5. CAPGEMINI OFF-CAMPUS DRIVES 5. 2022 BATCH

 

To Stay Up-to-date, Follow us on Social Media:


1.      Join our Telegram Channel:

Click Here

2.      Like us on Facebook:

Click Here

3.      Follow us on Instagram:

Click Here

4.      Follow us on LinkedIn:

Click Here

5.      Follow us on Google News:

Click Here

 

ADAPT Different Coding Solutions:


  1. Largest Array Solution – Click Here
  2. Batsman & Bowler Solution – Click Here
  3. Instruments Problem Solution – Click Here
  4. Check Two Person Are Same – Click Here
  5. Medicine App ADAPT Solution – Click Here
  6. String Combination Capgemini ADAPT Solution – Click Here
  7. Remove”X”inString Problem Solution – Click Here
  8. Customer and Invoice ADAPT Problem Solution – Click Here

Capgemini ADAPT Sprint 1 (Bus Reservation Solutions):


Capgemini ADAPT Sprint 2 (Bus Reservation System):


Study Materials for Interview Preparation (FREE MATERIALS):


  1. 240 Core Java Questions & Answers with PDF Download Link – Click Here
  2. 230+ SQL interview questions & answers pdf download – Click Here
  3. 50 LeetCode Interview Questions with Answers – PDF Notes – Click Here