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

Capgemini ADAPT 2022 Online Shopping A - Customer & Address Class Solution using JAVA
Capgemini ADAPT 2022 Online Shopping A - Customer & Address Class Solution using JAVA

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 password;
private String firstName;
private String lastName;
private String city;
private String gender;
private long phoneNumber;
private Address address;
public Customer() {
}
@Override
public String toString() {
String result =”Customer [userId=”+userId+ “, “;
result += “emailId=”+emailId + “, “;
result +=”password=”+ password + “, “;
result +=”firstName=”+ firstName + “, “;
result +=”lastName=”+ lastName + “, “;
result +=”city=”+ city +”, “;
result +=”gender=”+ gender +”, “;
result +=”phoneNumber=”+ phoneNumber +”, “;
result +=”address=”+ address+”]”;
return result;
}
public Customer(int userId, String emailId, String password, String
firstName, String lastName, String city, String gender, long
phoneNumber, Address address) {
this.userId = userId;
this.emailId = emailId;
this.password = password;
this.firstName = firstName;
this.lastName = lastName;
this.city = city;
this.gender = gender;
this.phoneNumber = phoneNumber;
this.address = address;
}
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 getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
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;
}
public Address getAddress() {
return address;
}
public void setAddress(Address address) {
this.address = address;
}
}
class Address {
private String city;
private String state;
private int zip;
private String country;
public Address() {
}
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 password = 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();
Address address = new Address(city, state, zip, country);

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
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
  12. Product of Digits Problem Solution – Click Here
  13. Change Using Minimal Coins/Notes 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

ADAPT Sprint 3 Solutions – Capgemini (Toy Rental A):


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