Registered Customer Problem Solution in Java | Capgemini ADAPT 2022 Solution using Java

Registered Customer Problem Solution in Java | Capgemini ADAPT 2022 Solution using Java
Registered Customer 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 Registered Customer in Java. Capgemini ADAPT Java Solutions 2022, Registered Customer.

Note: The solutions are provided for learning purposes only. 

Registered Customer Problem Description:


Inheritance-Aggregation.

• Create classes Customer. Registered Customer. Address and identify the appropriate relationship between these 3 classes.

• Create only get methods of Customer Class

• Create set/get methods for the Address class

Create set/get methods for Registered Customer class

• Create a Constructor for Customer with parameter list given below

Customer (String custid. String custname Address address

• Create a Constructor for Register Customer with parameter lis

give below

• Reg Customer (String custid, String custname, Address

address, double fees);

• Print the Details of RegCustomer which should also be in the

details passed to the Address of that Registerd Customer.

Capgemini ADAPT 2022 – Registered Customer Problem Solution in Java:


import java.util.*;

class Address

{

String l1,l2,city,pin;

Address(String a,String b,String c,String d)

{

l1=a;

l2=b;

city=c;

pin=d;

}

void setl1(String x)

{

this.l1=x;

}

String getl1()

{

return this.l1;

}

void setl2(String x)

{

this.l2=x;

}

String getl2()

{

return this.l2;

}

void setcity(String x)

{

this.city=x;

}

String getcity()

{

return this.city;

}

void setpin(String x)

{

this.pin=x;

}

String getpin()

{

return this.pin;

}

}

class Cust

{

String custid,custname;

Address address;

Cust(String custid, String custname, Address address)

{

this.custid=custid;

this.custname=custname;

this.address=address;

}

String getcustid()

{

return this.custid;

}

String getcustname()

{

return this.custname;

}

String getl1()

{

return this.address.l1;

}

String getl2()

{

return this.address.l2;

}

String getcity()

{

return this.address.city;

}

String getpin()

{

return this.address.pin;

}

}

class RegCustomer extends Cust

{

double fees;

RegCustomer(String custid, String custname, Address address,double fees)

{

super(custid,custname,address);

this.fees=fees;

}

void setcustid(String x)

{

this.custid=x;
}

void setcustname(String x)

{

this.custname=x;

}

void setfees(double x)

{

this.fees=x;

}

void setl1(String x)

{

this.address.l1=x;

}

void setl2(String x)

{

this.address.l2=x;

}

void setcity(String x)

{

this.address.city=x;

}

void setpin(String x)

{

this.address.pin=x;

}

double getfees()

{

return this.fees;

}

void display()

{ System.out.println("CustomerId:"+this.custid+"\nCustomerName:"+this.custname+"\nCustomerfees:"+this.fees); System.out.println("Address1:"+this.address.l1+"\nAddress2:"+this.address.l2+"\nCity:"+this.address.city); System.out.println("Pin:"+this.address.pin);

}

}

public class Source { public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

String l1=sc.nextLine();

String l2=sc.nextLine();

String city=sc.nextLine();

String pin=sc.nextLine();

Address a=new Address(l1,l2,city,pin);

String custId=sc.nextLine();

String custName=sc.nextLine();

double fees=sc.nextDouble();

RegCustomer ob=new RegCustomer(custId,custName,a,fees);

ob.display();

}

}

Top Companies + Batchwise Hiring Drive:


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
  9. Book and Author Problem Solution – Click Here
  10. Highest Feedback Problem Solution – Click Here
  11. Registered Customer Problem Solution in Java – 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