Preview

Tmg Stl Test Essay Example

Good Essays
Open Document
Open Document
881 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Tmg Stl Test Essay Example
Test Instructions: 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. 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.org/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!

You May Also Find These Documents Helpful

  • Satisfactory Essays

    IT210 Week 3

    • 756 Words
    • 4 Pages

    Resources: Review the example in Appendix E and the additional examples on pgs 80-83 of Prelude to Programming…

    • 756 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Nt1420 Unit 6

    • 1145 Words
    • 5 Pages

    INSTRUCTIONS: 1. THERE ARE SIX (6) QUESTIONS IN THIS PAPER. 2. ANSWER FIVE (5) QUESTIONS ONLY. Question 1 Arrays are used when storing a large number of values. You are required to create an array named a and answer the following questions regarding array manipulation. a. Write a method fillRandom(int[] a, int min, int max), fill the array a with a random integer value. (Note: Math.random() returns a double in the range of 0.0 and 1.0, therefore it is cast to an integer number, between the minimum and maximum value). [6 marks] b. Write the Bubble sort method to sort array a into descending order. [10 marks] c. In the quicksort, an algorithm an element is chosen from the unsorted list. This element is called the…

    • 1145 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Due Date: February 20, 2012 by 5:00pm. ABSOLUTELY NO LATE ASSIGNMENTS Instructions: Complete the question below in pairs. Please note that your code should contain proper comments.…

    • 703 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Arrays store items that have the same type of data type like a group of employees’ names and social security numbers for a team of 2000 personal. Pointer is a variable that greatly extends the power and flexibility of a program, each memory location that is used to store data value has an address. The address provides the means for a PC hardware to reference a particular data item.…

    • 485 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Pt1420 Unit 1 Assignment 2

    • 1305 Words
    • 6 Pages

    Das, D., Gregersen, E., Hosch, L., Lotha, G., Sampaolo, M., Sinha, S. (2014). C++. In Encyclopedia Britannica.…

    • 1305 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    CTS 2437 Final Exam

    • 630 Words
    • 4 Pages

    You should provide (1) a screen shot of your solution and (2) code for your solution, copied/pasted into this document. Each problem is worth 20 points.…

    • 630 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    SCI 256 Final Exam 1

    • 1357 Words
    • 7 Pages

    Read the directions carefully. Note that the exam is worth a maximum of 15 points (15% of your course grade). Some items are required, and some offer choices of which ones to complete. Responses must be in your own words (no copied content or quotations allowed) in the cells provided; the cells will expand downward as you type. You do not need to cite sources for this test, especially because no copied content is permitted. Be advised that any copied content will not earn points. Please leave the two right-hand scoring columns alone; the instructor will complete those during grading.…

    • 1357 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    unit 3

    • 313 Words
    • 2 Pages

    7. Write a pseudocode statement that assigns the value of 27 to the variable count.…

    • 313 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Problem Statement: The POW starts off with the random 3-digit number 473 and number the problem says to arrange the digits from largest to smallest, which is 743. Then arrange the digits from smallest to largest, which is 347. The arrangement of the digits from least to greatest is subtracted from the arrangement of those same digits from greatest to least. The problem we ultimately end up doing is 473-347 and the difference is 396. The problem asks the students to continue the process of choosing a number, arranging its digits so the lowest arrangement of the digits is subtracted from the highest arrangement of the digits. The problem also asks the readers to test out the steps using 3, 4, 5, 6 and so forth and explain what they discover.…

    • 412 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    1. __________ argues that societies invent the concept of mental illness so that they can control people whose unusual patterns of functioning upset or threaten the social order.…

    • 3605 Words
    • 15 Pages
    Good Essays
  • Good Essays

    Nothing

    • 1097 Words
    • 5 Pages

    6) Write (in the same base) the counting numbers just before and just after DB2 sixteen. A) CA1sixteen, EC3sixteen B) DBsixteen, DB4sixteen C) DB1 sixteen, DB3sixteen 7) List the first 10 counting numbers in base 9. A) 1, 2, 4, 5, 7, 8, A, B, C, D C) 1, 2, 3, 4, 5, 6, 7, 8, 10, 11 D) CA1sixteen, CA3 sixteen…

    • 1097 Words
    • 5 Pages
    Good Essays
  • Good Essays

    (This source helped me a lot to answer most of Part A, as it had all the information required).…

    • 772 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Jquery

    • 25732 Words
    • 103 Pages

    2. Starting with the framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25…

    • 25732 Words
    • 103 Pages
    Satisfactory Essays
  • Good Essays

    Prime Number and Ans

    • 1377 Words
    • 6 Pages

    There are a few trick questions. Some questions can be quickly answered if you chance upon the right approach, but the 'long' solution isn't too arduous. Several of the questions are best answered by writing a computer program. Some are shown here.…

    • 1377 Words
    • 6 Pages
    Good Essays
  • Good Essays

    TOEFL Essay

    • 461 Words
    • 2 Pages

    It seems that people always have a desire to compare: am I prettier than others? Are we living in a better age? Or, as the question goes, is our life easier and more enjoyable than it was several decades ago? I would say no, as I have witnessed the struggle and paradox of our generation.…

    • 461 Words
    • 2 Pages
    Good Essays