Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package examples;
- public class PseudoExample {
- public static void main(String[] args) {
- //How to write pseudo code
- //Program is a clone of the Post Office. It includes mailmen, drivers, and their equipment.
- //*My classes*
- VehicleFleet fleet;
- PostOffice office;
- //Staff
- Mailman mailmen;
- Driver driver; // Both inherit from Person
- List<Mailman> mailmen = new ArrayList<>(); //How the mailmen are stored
- List<Driver> drivers = new ArrayList<>(); // How the drivers are stored
- //Vehicles
- Truck truck;
- Sedan sedan;
- Van van;
- //Items
- Envelope envelope;
- MailBag bag;
- //Populating the post office
- for(officeSize) {
- office.addMailMan(new MailMan(age, name, rank));
- }
- //Populating the fleet
- for(fleetSize) {
- fleet.addVehicle(new Truck(engine, manufacturer));
- }
- //Assign drivers to vehicles
- for(fleetSize) {
- fleet.getVehicles().get(i).assignDriver(new Driver(age, name, license));
- }
- //Asign bags to mailmen
- for(officeSize) {
- office.getStaff().get(i).assignBagToMailman(new MailBag(new Envelope) { /*mail*/ });
- }
- //Distribute mail
- for(mailInboxSize) {
- mailman.sendMail(mailInbox.getMail().get(i));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement