Monday, April 27, 2020

Tmg Stl Test free essay sample

Please complete questions 1 through 7 as quickly as possible. Try to find the most efficient way to solve the problems. Use C++, C# or Java to complete the exercises. When using C++ you can use STL for data containers. For number 8, take your time and write a complete solution in C++ that can be run and played with All answers must be packaged as complete program solutions compile-able and run-able in the chosen language environment. Rules- This test is confidential. Please do not share this with anyone. You may use any resources you want, but you should work on this exam alone. 1. A military company has 100 soldiers. Every soldier has a uniquely numbered shoulder patch. The shoulder patches start from 1 for the first soldier, 2 for the second, and so on all the way to 100 for the 100th soldier. Right before the deployment, when the company is almost ready to board a plane, the company Commander finds out there was a spy among them who deserted last night. We will write a custom essay sample on Tmg Stl Test or any similar topic specifically for you Do Not WasteYour Time HIRE WRITER Only 13.90 / page The soldiers are all upset and there is no time for a line up but the Commander finds a way to find out who was the spy by asking every soldier his or her patch number just once when they board the plane, even though they board in no particular order. Write a program that shows how the commander found the spy. The program should accept an array of soldiers’ patch numbers and return spy’s patch number. 2. Bus tickets are numbered with a 6 digits number from 000000 to 999999. Write a program that counts number of all lucky bus tickets. A Ticket is considered to be lucky if the sum of the first 3 digit equals the sum of last 3 digits. Example 123321 when broken a part is (1+2+3=6) and (3+2+1=6). 3. Italian authorities decided to add balconies to the Pisa tower. (http://en. wikipedia. rg/wiki/Leaning_Tower_of_Pisa )To do so they need to insert steel beams into the tower wall perpendicular to the wall itself, otherwise balconies will be even more crooked than tower itself! Building contractors use GPS that can tell them coordinates of any point on a tower wall or on the steel beam. They can take as many measurements as they want. Write a program that uses GPS readings as input and helps building contractor to check that t he balcony steel beam is inserted correctly and is perpendicular to the tower wall. 4. The US government offers to sell you a $100, zero coupon treasury bond at 95. 50. The bond will come to maturity in 153 days. Write a program that calculates rate of return on a $100 treasury bond given its current price and days to maturity. 5. The Prince of Persia has been thrown onto the top level of Jaffars  underground  labyrinth. The  labyrinth  consists of  h  levels strictly on top of each other. Each level is split into  m  by  n  areas. Some areas have columns that support  ceiling, some areas are free. The Prince can move only to free areas. To move to the level below the Prince can break the floor  underneath  him and jump down if there is no column underneath. Every move takes the Prince 5 seconds. A Princess is waiting for the Prince at the lowest level. Write a program that will help the Prince to save the Princess as fast as possible by finding the shortest path between them and outputting time it took the Prince to find the Princess. The structure of the labyrinth is given bellow. The Prince’s location is marked with 1, the Princess’s location is marked with 2. ‘. ’ marks a free spot and ‘o’ marks a column. 1 . . o o . . . . o o o . . o . o o o o o o . . o . 2 PS. Because good always trumps evil you can assume that there is always a way for Prince to find his Princess. 6. Write a program that converts a number to a print form (like check writer) Example: input: 561 =gt; output: Five Hundred Sixty One input: 12340982 =gt; Output: Twelve million three hundred forty thousand nine hundred eighty two 7. Consider two time series. Each time series contains price and time. Time is expressed in number of seconds since market open. Every time when price changes – there is a new entry into time series. Write a program that receives two inputs: time series 1 and 2, and calculates another time series containing the price difference (spread) between the two products at fixed 10 seconds interval. Example: Input: Time Series 1| Time Series 2| Time| Price| Time| Price| 0| 1250. 00| 0| 1680. 50| 4| 1275. 00| 10| 1682. 00| 15| 1275. 00| 30| 1679. 50| 230| 1274. 00| 198| 1679. 75| Output: Resulting Time series| Time| Price| 0| ? | 10| ? | 20| ? | 30| ? | †¦| | 28800| ? | 8. Kalah Project: Write a program that can play the game of Kalah (http://en. wikipedia. org/wiki/Kalah) against a human opponent. The initial number of seeds is 30 for each player but they are allocated into houses randomly. Use Console to communicate board amp; moves.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.