# Online Shopping A – Customer & Address Class Solution | Capgemini ADAPT 2022 Solutions

In this post, we will try to give a solution to an important problem of Capgemini ADAPT 2022. The problem is Online Shopping A – JOLS-S4-L3-1- Customer and Address Class.

However, the solutions are provided for learning purposes only. Candidates must submit their own code during attending the Sprints.

### Online Shopping A – JOLS-S4-L3-1- Customer and Address Class Solution:

import java.util.*;
class Customer {
private int userId;
private String emailId;
private String firstName;
private String lastName;
private String city;
private String gender;
private long phoneNumber;
public Customer() {
}
@Override
public String toString() {
String result =”Customer [userId=”+userId+ “, “;
result += “emailId=”+emailId + “, “;
result +=”firstName=”+ firstName + “, “;
result +=”lastName=”+ lastName + “, “;
result +=”city=”+ city +”, “;
result +=”gender=”+ gender +”, “;
result +=”phoneNumber=”+ phoneNumber +”, “;
return result;
}
public Customer(int userId, String emailId, String password, String
firstName, String lastName, String city, String gender, long
this.userId = userId;
this.emailId = emailId;
this.firstName = firstName;
this.lastName = lastName;
this.city = city;
this.gender = gender;
this.phoneNumber = phoneNumber;
}
public int getUserId() {
return userId;

}
public void setUserId(int userId) {
this.userId = userId;
}
public String getEmailId() {
return emailId;
}
public void setEmailId(String emailId) {
this.emailId = emailId;
}
}
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getGender() {
return gender;

}
public void setGender(String gender) {
this.gender = gender;
}
public long getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(long phoneNumber) {
this.phoneNumber = phoneNumber;
}
}
}
}
private String city;
private String state;
private int zip;
private String country;
}
public Address(String city, String state, int zip, String country) {
this.city = city;
this.state = state;
this.zip = zip;
this.country = country;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {

return state;
}
public void setState(String state) {
this.state = state;
}
public int getZip() {
return zip;
}
public void setZip(int zip) {
this.zip = zip;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
@Override
public String toString() {
String result =”Address [city=”+ city + “, “;
result +=”state=”+ state + “, “;
result +=”zip=”+ zip + “, “;
result +=”country=”+ country+”]”;
return result;
}
}
public class Source {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int userId = Integer.parseInt(scanner.next());
String emailId = scanner.next();
String firstName = scanner.next();
String lastName = scanner.next();
String city = scanner.next();
String gender = scanner.next();
long phoneNumber = Long.parseLong(scanner.next());
String state = scanner.next();
int zip = Integer.parseInt(scanner.next());
String country = scanner.next();

Customer customer = new Customer(userId, emailId, password,
firstName, lastName, city, gender, phoneNumber, address);
System.out.println(customer);
scanner.close();
}
}

Note: We could not get the problem statement yet. If you have the problem statement you can send us at – [email protected]. We will try to update the answers according to the problem statement.

### Top Companies + Batchwise Hiring Drive:

 TOP COMPANIES HIRING DRIVE BATCHWISE HIRING DRIVES

### 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

### Online Shopping A Solutions Using Java:

• 1. Capgemini ADAPT 2022 Online Shopping A – Display Products Solution using JAVA – Click Here
• 2. Capgemini ADAPT 2022 Online Shopping A – Products by Category Solution using JAVA – Click Here
• 3. Capgemini ADAPT 2022 Online Shopping A – Customer Array Solution using JAVA – Click Here
• 4. Capgemini ADAPT 2022 Online Shopping A – Search Customers by Name Solution using JAVA – Click Here
• 5. Capgemini ADAPT 2022 Online Shopping A – Search Customers by City Solution using JAVA – Click Here

Job Seeker 24 provides Off-Campus Drive Updates, Engineering Job Updates, IT Job Updates, Jobs for Freshers, Private Sector Jobs, Public Sector Jobs, various Educational Opportunities, etc.