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.
Table of Contents
- Registered Customer Problem Description:
- Capgemini ADAPT 2022 – Registered Customer Problem Solution in Java:
- Top Companies + Batchwise Hiring Drive:
- To Stay Up-to-date, Follow us on Social Media:
- ADAPT Different Coding Solutions:
- Capgemini ADAPT Sprint 1 (Bus Reservation Solutions):
- Capgemini ADAPT Sprint 2 (Bus Reservation System):
- Study Materials for Interview Preparation (FREE MATERIALS):
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:
- Largest Array Solution – Click Here
- Batsman & Bowler Solution – Click Here
- Instruments Problem Solution – Click Here
- Check Two Person Are Same – Click Here
- Medicine App ADAPT Solution – Click Here
- String Combination Capgemini ADAPT Solution – Click Here
- Remove”X”inString Problem Solution – Click Here
- Customer and Invoice ADAPT Problem Solution – Click Here
- Book and Author Problem Solution – Click Here
- Highest Feedback Problem Solution – Click Here
- Registered Customer Problem Solution in Java – Click Here
Capgemini ADAPT Sprint 1 (Bus Reservation Solutions):
- 1. Capgemini ADAPT Sprint 1 Bus Reservation System – DisplayCustomerInAscendingOrder Problem Solution
- 2. Capgemini ADAPT Sprint 1 Bus Reservation System – DisplayCustomerByFirstName Problem Solution
- 3. Capgemini ADAPT Sprint 1 Bus Reservation System – SortByCustomerId Problem Solution
- 4. Capgemini ADAPT Sprint 1 Solution Java | LSAByCustomerName Problem Solution
- 5. Capgemini ADAPT Sprint 1 Case Study Solution Java | BSAByCustomerId Problem Solution
Capgemini ADAPT Sprint 2 (Bus Reservation System):
- 1. Capgemini ADAPT Sprint 2 Case Study (Bus Reservation System) Solution | HAS-A-Relationship Solution Java
- 2. Capgemini ADAPT Sprint 2 Case Study (Bus Reservation System) Solution OOPs-Para-Constructor Java
- 3. Capgemini ADAPT Sprint 2 Bus Reservation System (CRUDOperations) Problem Solution
Study Materials for Interview Preparation (FREE MATERIALS):
- 240 Core Java Questions & Answers with PDF Download Link – Click Here
- 230+ SQL interview questions & answers pdf download – Click Here
- 50 LeetCode Interview Questions with Answers – PDF Notes – Click Here