Question::

Grade settings: Maximum grade: 100 
Disable external file upload, paste and drop external content: Yes
 Run: Yes 
Evaluate: Yes 
Automatic grade: Yes 
Maximum execution time: 16

 SmartBuy is a leading mobile shop in the town. After buying a product, the customer needs to provide a few personal details for the invoice to be generated. 

You being their software consultant have been approached to develop software to retrieve the personal details of the customers, which will help them to generate the invoice faster.


In the Main class, create an object for the Customer class. 

Get the details as shown in the sample input and assign the value for its attributes using the setters.

 Display the details as shown in the sample output using the getters method.

 All classes and methods should be public, Attributes should be private.

 Note: In the Sample Input / Output provided, the highlighted text in bold corresponds to the input given by the user and the rest of the text represents the output. 

Ensure to follow the object oriented specifications provided in the question. 

Ensure to provide the names for classes, attributes and methods as specified in the question. 

Adhere to the code template, if provided.


Code::

customer.java::

 public class Customer { 
 private String customerName; 
 private long contactNumber; 
 private String emailId; 
 private int age; 
 public String getCustomerName() { 
 return customerName; 
 } 
public void setCustomerName(String customerName) { 
this.customerName = customerName; 
 public long getContactNumber() { 
 return contactNumber; 
 } 
 public void setContactNumber(long contactNumber) { 
 this.contactNumber = contactNumber; 
 } 
 public String getEmailId() { 
 return emailId; 
 } 
 public void setEmailId(String emailId) { 
 this.emailId= emailId; 
 } 
 public int getAge() { 
 return age; 
 } 
 public void setAge(int age){ 
this.age = age; 
 } 
 }

main.java::


import java.util.Scanner;

public class Main { 
 public static void main (String[] args) { 
Scanner sc=new Scanner(System.in); 
 
Customer c=new Customer(); 
 System.out.println("Enter the Name:"); 
 String name=(sc.nextLine()); 
 System.out.println("Enter the ContactNumber:"); 
 long no=sc.nextLong(); 
 sc.nextLine(); 
 System.out.println("Enter the EmailId:"); 
 String mail=sc.nextLine(); 
 System.out.println("Enter the Age:"); 
 int age=sc.nextInt(); 
c.setCustomerName(name); 
 c.setContactNumber(no); 
 c.setEmailId(mail); 
 c.setAge(age); 
 System.out.println("Name:"+c.getCustomerName()); 
 System.out.println("ContactNumber:"+c.getContactNumber()); 
 System.out.println("EmailId:"+c.getEmailId()); 
 System.out.println("Age:"+c.getAge()); 
 } 
 }