Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the following C++ class to create a working implementation in Java. You are welcome to write a separate class containing the main method to

Use the following C++ class to create a working implementation in Java. You are welcome to write a separate class containing the main method to test out your class, but it is not required for this quiz. Please put this class in the following package: cpsc2150.quizzes

#include  using namespace std; class Person { public: // Constructor: sets firstName and lastName according to the parameters. // @pre [ first and last names are valid ] // @post firstName = first AND lastName = last Person(string first, string last); // Function to output the first name and last name in the form (with a space separating the two strings): firstName lastName // @pre None // @post [ Output person's name to console ] AND firstName = #firstName AND lastName = #lastName void print() const; // Function to set firstName and lastName according to the parameters // @pre [ first and last names are valid ] // @post firstName = first AND lastName = last void setName(string first, string last); // Function to return the first name // @pre None // @post getFirstName = firstName AND firstName = #firstName AND lastName = #lastName string getFirstName() const; // Function to return the last name // @pre None // @post getLastName = lastName AND firstName = #firstName AND lastName = #lastName string getLastName() const; private: string firstName; string lastName; };

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

Differentiate between a compliance audit and an operational audit.

Answered: 1 week ago

Question

Does it have correct contact information?

Answered: 1 week ago