SHARE
TWEET

PseudoCode

PasteyMash Jul 18th, 2019 (edited) 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package examples;
  2.  
  3. public class PseudoExample {
  4.  
  5.     public static void main(String[] args) {
  6.         //How to write pseudo code
  7.        
  8.         //Program is a clone of the Post Office. It includes mailmen, drivers, and their equipment.
  9.        
  10.         //*My classes*
  11.         VehicleFleet fleet;
  12.         PostOffice office;
  13.         //Staff
  14.         Mailman mailmen;
  15.         Driver driver; // Both inherit from Person
  16.         List<Mailman> mailmen = new ArrayList<>(); //How the mailmen are stored
  17.         List<Driver> drivers = new ArrayList<>(); // How the drivers are stored
  18.         //Vehicles
  19.         Truck truck;
  20.         Sedan sedan;
  21.         Van van;
  22.         //Items
  23.         Envelope envelope;
  24.         MailBag bag;
  25.        
  26.        
  27.         //Populating the post office
  28.         for(officeSize) {
  29.             office.addMailMan(new MailMan(age, name, rank));
  30.         }
  31.         //Populating the fleet
  32.         for(fleetSize) {
  33.             fleet.addVehicle(new Truck(engine, manufacturer));
  34.         }
  35.        
  36.         //Assign drivers to vehicles
  37.         for(fleetSize) {
  38.             fleet.getVehicles().get(i).assignDriver(new Driver(age, name, license));
  39.         }
  40.         //Asign bags to mailmen
  41.         for(officeSize) {
  42.             office.getStaff().get(i).assignBagToMailman(new MailBag(new Envelope) { /*mail*/ });
  43.         }
  44.         //Distribute mail
  45.         for(mailInboxSize) {
  46.             mailman.sendMail(mailInbox.getMail().get(i));
  47.         }
  48.        
  49.     }
  50.  
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top