C++ start up code and specifications are there.
Assignment1-2014-startup-code.7z
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/bin/Debug/Assignment1-2014.mp3
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/obj/Debug/Assignment1-2014.mp3
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/bin/Debug/Assignment1-2014.vshost.mp3
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Assignment1-2014")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("University of Ballarat")] [assembly: AssemblyProduct("Assignment1-2014")] [assembly: AssemblyCopyright("Copyright © University of Ballarat 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2ab846e0-39fd-40f2-b065-cc3a5fbdd345")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/Customer.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Assignment1_2014 { public class Customer { int discount = 1; String lastname, firstname; String accountNumber; public Customer(String firstname, String lastname, String accountNumber) { this.firstname = firstname; this.lastname = lastname; this.accountNumber = accountNumber; } } }
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/Program.cs
using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Assignment1_2014 { class Program { static void Main(string[] args) { UBCruises bookings = new UBCruises (); Customer cust1 = new Customer ("Fred", "Johnstone", "A100356"); Reservation booking = bookings.bookPassage("C", cust1, 2); Console.WriteLine ("Cust1's booking costs = {0}", booking.cost); Console.Write ("Cabins booked are: "); ArrayList cabins = booking.cabins; for (int i = 0; i < cabins.Count; i++) Console.Write ("{0}\t", ((room) cabins[i]).number); Console.WriteLine(); Console.WriteLine(); Customer cust2 = new Customer("Jane", "Jackson", "M892039"); Reservation booking2 = bookings.bookPassage("H", cust2, 4); Console.WriteLine("Cust2's booking costs = {0}", booking2.cost); Console.Write("Cabins booked are: "); cabins = booking2.cabins; for (int i = 0; i < cabins.Count; i++) Console.Write("{0}\t", ((room)cabins[i]).number); Console.WriteLine(); Console.ReadLine(); } } }
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/Reservation.cs
using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Assignment1_2014 { public class Reservation { public Customer booker; public Boolean confirmed = true; public int cost; public ArrayList cabins = new ArrayList(); public Reservation(Customer booker, Boolean confirmed) { this.booker = booker; this.confirmed = confirmed; } public Reservation(Customer booker, int cost, ArrayList cabins) { this.booker = booker; this.cost = cost; this.cabins = cabins; } public Reservation(Customer booker, int cost, room theCabin) { this.booker = booker; this.cost = cost; cabins.Add(theCabin); } } }
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/room.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Assignment1_2014 { public class room { public int fare; public String number; public Boolean booked = false; public room(int fare, String number) { this.fare = fare; this.number = number; } } }
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/Ship.cs
using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Assignment1_2014 { public class Ship { Dictionary<String, ArrayList> cabins = new Dictionary<String, ArrayList>(); String name; public Ship(String name) { this.name = name; } public void addDeck(String deckName, ArrayList cabins) { this.cabins.Add(deckName, cabins); } public ArrayList getDeck(String deckName) { return (ArrayList)cabins[deckName]; } } }
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/UBCruises.cs
using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Assignment1_2014 { public class UBCruises { Ship ship1; public UBCruises() { setupShip(); } public void setupShip() { ship1 = new Ship("Olympic Countess"); ArrayList groupA = new ArrayList(); for (int i = 0; i < 10; i++) { groupA.Add(new room(5000, "A" + (i + 1))); } ArrayList groupB = new ArrayList(); for (int i = 0; i < 10; i++) { groupB.Add(new room(4000, "B" + (i + 1))); } ArrayList groupC = new ArrayList(); for (int i = 0; i < 30; i++) { groupC.Add(new room(3500, "C" + (i + 1))); } ArrayList groupD = new ArrayList(); for (int i = 0; i < 36; i++) { groupD.Add(new room(3400, "D" + (i + 1))); } ArrayList groupE = new ArrayList(); for (int i = 0; i < 40; i++) { groupE.Add(new room(3300, "E" + (i + 1))); } ArrayList groupF = new ArrayList(); for (int i = 0; i < 30; i++) { groupF.Add(new room(3400, "F" + (i + 1))); } ArrayList groupG = new ArrayList(); for (int i = 0; i < 36; i++) { groupG.Add(new room(3300, "G" + (i + 1))); } ArrayList groupH = new ArrayList(); for (int i = 0; i < 40; i++) { groupH.Add(new room(3200, "H" + (i + 1))); } ship1.addDeck("Balcony Suite", groupA); ship1.addDeck("Suite", groupB); ship1.addDeck("Deck 3 - Outside Twin", groupC); ship1.addDeck("Deck 2 - Outside Twin", groupD); ship1.addDeck("Deck 1 - Outside Twin", groupE); ship1.addDeck("Deck 3 - Inside Twin", groupF); ship1.addDeck("Deck 2 - Inside Twin", groupG); ship1.addDeck("Deck 1 - Inside Twin", groupH); } public Reservation bookPassage(String cabinclass, Customer booker, int number) { ArrayList cabins; if (cabinclass.Equals("a", StringComparison.OrdinalIgnoreCase)) cabins = ship1.getDeck("Balcony Suite"); else if (cabinclass.Equals("b", StringComparison.OrdinalIgnoreCase)) cabins = ship1.getDeck("Suite"); else if (cabinclass.Equals("c", StringComparison.OrdinalIgnoreCase)) cabins = ship1.getDeck("Deck 3 - Outside Twin"); else if (cabinclass.Equals("d", StringComparison.OrdinalIgnoreCase)) cabins = ship1.getDeck("Deck 2 - Outside Twin"); else if (cabinclass.Equals("e", StringComparison.OrdinalIgnoreCase)) cabins = ship1.getDeck("Deck 1 - Outside Twin"); else if (cabinclass.Equals("f", StringComparison.OrdinalIgnoreCase)) cabins = ship1.getDeck("Deck 3 - Inside Twin"); else if (cabinclass.Equals("g", StringComparison.OrdinalIgnoreCase)) cabins = ship1.getDeck("Deck 2 - Inside Twin"); else cabins = ship1.getDeck("Deck 1 - Inside Twin"); if (available(cabins, number)) { ArrayList bookedcabins = new ArrayList(); int currentCabin = 0; int cost = 0; while (number > 0) { room thisCabin = (room)cabins[currentCabin]; if (!thisCabin.booked) { bookedcabins.Add(thisCabin); cost += thisCabin.fare; number--; } currentCabin++; } return new Reservation(booker, cost, bookedcabins); } else return new Reservation(booker, false); } public Boolean available(ArrayList cabins, int number) { int freeCount = 0; for (int i = 0; i < cabins.Count; i++) { if (!((room)cabins[i]).booked) freeCount++; } return number <= freeCount; } } }
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/Assignment1-2014.csproj
Debug AnyCPU {ECDE9687-8086-4F78-9201-AF663AE28F1D} Exe Properties Assignment1_2014 Assignment1-2014 v4.5 512 AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 AnyCPU pdbonly true bin\Release\ TRACE prompt 4
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assignment1-2014", "Assignment1-2014\Assignment1-2014.csproj", "{ECDE9687-8086-4F78-9201-AF663AE28F1D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {ECDE9687-8086-4F78-9201-AF663AE28F1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ECDE9687-8086-4F78-9201-AF663AE28F1D}.Debug|Any CPU.Build.0 = Debug|Any CPU {ECDE9687-8086-4F78-9201-AF663AE28F1D}.Release|Any CPU.ActiveCfg = Release|Any CPU {ECDE9687-8086-4F78-9201-AF663AE28F1D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/obj/Debug/Assignment1-2014.csproj.FileListAbsolute.txt
c:\users\psmith\documents\visual studio 2012\Projects\Assignment1-2014\Assignment1-2014\bin\Debug\Assignment1-2014.exe.config c:\users\psmith\documents\visual studio 2012\Projects\Assignment1-2014\Assignment1-2014\bin\Debug\Assignment1-2014.exe c:\users\psmith\documents\visual studio 2012\Projects\Assignment1-2014\Assignment1-2014\bin\Debug\Assignment1-2014.pdb c:\users\psmith\documents\visual studio 2012\Projects\Assignment1-2014\Assignment1-2014\obj\Debug\Assignment1-2014.exe c:\users\psmith\documents\visual studio 2012\Projects\Assignment1-2014\Assignment1-2014\obj\Debug\Assignment1-2014.pdb c:\users\psmith\documents\visual studio 2012\Projects\Assignment1-2014\Assignment1-2014\obj\Debug\Assignment1-2014.csprojResolveAssemblyReference.cache
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/bin/Debug/Assignment1-2014.pdb
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/obj/Debug/Assignment1-2014.pdb
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/obj/Debug/Assignment1-2014.csprojResolveAssemblyReference.cache
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/App.config
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/bin/Debug/Assignment1-2014.exe.config
Assignment1-2014-startup-code/Assignment1-2014/Assignment1-2014/bin/Debug/Assignment1-2014.vshost.exe.config