import Foundation
class Customer{
var FirstName: String
var LastName: String
var Address: String
var Address2: String
var City: String
var State: String
var Zip: Int
init(){
FirstName = ""
LastName = ""
Address = ""
Address2 = ""
City = ""
State = ""
Zip = 0
}
Create a function that will print each of the attributes out to the console. Remember, zip code is an integer, and you will need keep this in mind when you are trying to print it as a string. Name this function printCustomer().
In case of any query, do comment. Please rate answer. Thanks
Code:
import Foundation
class Customer{
var FirstName: String
var LastName: String
var Address: String
var Address2: String
var City: String
var State: String
var Zip: Int
init(){
FirstName = ""
LastName = ""
Address = ""
Address2 = ""
City = ""
State = ""
Zip = 0
}
//method to print attributes of Customer Class
func printCustomer(){
print("Customer first name is: \(FirstName) \r")
print("Customer last name is: \(LastName) \r")
print("Customer Address is: \(Address) \r")
print("Customer Address2 is: \(Address2) \r")
print("Customer City is: \(City) \r")
print("Customer State is: \(State) \r")
print("Customer Zip is: \(Zip) \r")
}
}
//main program, Creating object of Customer Class
let customer = Customer()
//Assigning values to attributes
customer.FirstName = "Charles"
customer.LastName = "Smith"
customer.Address = "401 Avenue"
customer.Address2 = "Near Macys"
customer.City = "Philadelphia"
customer.State = "Penssylvenia"
customer.Zip = 19086
//calling printCustomer method
customer.printCustomer()
=========screen shot of the code==============

Output:

import Foundation class Customer{ var FirstName: String var LastName: String var Address: String var Address2: String...
-----------------------------------
public class Customer
{
String firstName,lastName;
//constructor
public Customer(String firstName,String lastName)
{
this.firstName=firstName;
this.lastName=lastName;
}
//override toString() method
public String toString()
{
return this.lastName+", "+this.firstName;
}
boolean equals(Customer obj)
{
if(this.firstName.equals(obj.firstName) &&
this.lastName.equals(obj.lastName))
return true;
else
return false;
}
}
-----------------------------------
public class Ingredient
{
String ingredientName;
int amount;
double price;
public Ingredient(String ingredientName,int amount,double
price)
{
this.ingredientName=ingredientName;
this.amount=amount;
this.price=price;
}
double getCost()
{
return amount/1000.0*price;
}
public String toString()
{
return this.ingredientName+", "+this.amount+" mls,
$"+this.price+"/L";
}
}
-----------------------------------...
Swift code import Foundation protocol TaksPerformer { func doAThing() } class Employee: TaksPerformer { let name: String var boss: Boss? init(name: String) { self.name = name } func doAThing() { print("\(name) is doing a thing") } } class Boss { var employee: Employee let name: String init(name: String, employee: Employee) { self.name = name self.employee = employee employee.boss = self } func actLikeABoss() { employee.doAThing() } } // 1) // A) What is wrong with the current implementation of Boss...
Design a class for python named PersonData with the following member variables: lastName firstName address city state zip phone Write the appropriate accessor and mutator functions for these member variables. Next, design a class named CustomerData , which is derived from the PersonData class. The CustomerData class should have the following member variables: customerNumber mailingList The customerNumber variable will be used to hold a unique integer for each customer. The mailingList variable should be a bool . It will be...
7. PersonData and CustomerData classes Design a class named PersonData with the following member variables: lastName firstName address city state zip phone Write the appropriate accessor and mutator functions for these member variables. Next, design a class named CustomerData, which is derived from the PersonData class. The CustomerData class should have the following member variables: customerNumber mailinglist The customer Number variable will be used to hold a unique integer for each customer. The mailing List variable should be a bool....
Create a java class Customer.java that will represent a water company customer. It should contain the attributes, constructors, and methods listed below, and when finished should be able to allow the included file TestWaterBills.java to work correctly. Customer class Attributes firstName: String type, initial value null lastName: String type, initial value null streetAddress: String type, initial value null city: String type, initial value null state: String type, initial value null zip: String type, initial value null previousMeterReading: int type, initial...
Create the Employee class: The Employee class has three attributes: private: string firstName; string lastName; string SSN; The Employee class has ▪ a no-arg constructor (a no-arg contructor is a contructor with an empty parameter list): In this no-arg constructor, use “unknown” to initialize all private attributes. ▪ a constructor with parameters for each of the attributes ▪ getter and setter methods for each of the private attributes ▪ a method getFullName() that returns the last name, followed by a...
Create a java class Customer.java that will represent a water company customer. It should contain the attributes, constructors, and methods listed below, and when finished should be able to allow the included file TestWaterBills.java to work correctly. Customer class Attributes firstName: String type, initial value null lastName: String type, initial value null streetAddress: String type, initial value null city: String type, initial value null state: String type, initial value null zip: String type, initial value null previousMeterReading: int type, initial...
Please implement the following problem in basic C++ code and
include detailed comments so that I am able to understand the
processes for the solution. Thanks in advance.
// personType.h
#include <string>
using namespace std;
class personType
{
public:
virtual void print() const;
void setName(string first, string last);
string getFirstName() const;
string getLastName() const;
personType(string first = "", string last = "");
protected:
string firstName;
string lastName;
};
// personTypeImp.cpp
#include <iostream>
#include <string>
#include "personType.h"
using namespace std;
void...
Using Swift playground and / or the command line for macOS (open Xcode, create a new Xcode project, macOS, command line tool), practice the following exercises: Exercise: Swift Variables Declare 2 variables/constants with some random values and any name of your choice Considering these 2 variables, one as a value of PI and other as a radius of circle, find the area of circle Print the area of circle Declare a string variable explicitly with value “Northeastern”. Declare a string...
i have problem where the address is not save to my file after i input a new address and exit it #include<string> #include<iostream> #include<fstream> #include<sstream> using namespace std; typedef struct date { int day; int month; int year; }Date; typedef struct add { string building; string street; string city; string state; string zip; }Address; typedef struct entry { string firstName; string lastName; Address address; string phNo; Date...