9. Get Two Strings from User and Print the Both Strings in Such a Format That It Displays 0 Index Value of First Array Then Prints 0 Index Value of Second Array and It Goes on Like This for Example 1) Abcdef 2)

Good Essays
Topics: Sales
ASSIGNMENT

TOPIC ARRAYS

SUBMISSION DATE: - 28 -12-2010

VIVA IS CONDUCTED IN MY OFFICE ON TUESDAY (28-12-2010)

Q1: Write C++ statement to accomplish each of the following:

a) Display the value of the 7th element of character array F.

b) Input value into element 4 of single-subscripted floating point array B.

c) Initialize each of the 5 elements of single – subscripted integer array G to 8.

d) Total and print the floating point array C of 100 elements.

e) Copy array A into first portion of array B .assume float a[11], b[34];

f) Determine and print the smallest and largest value in 99 element floating point array W.

Q2) Make some simple modification in your Bubble Sort

a) After the first pass the largest number if guaranteed to be in the highest-numbered element of the array: after the second pass, the two highest numbers are “in place “so on. Instead of making nine comparisons of every pass, modify the bubble sort to make 8th comparisons on the second pass seven on the third pass and so on.

b) The data in array may be in proper order or near proper order so why will nine passes if fewer will suffice? Modify the sort to check at the end of each pass if any swap has been made. If none has been made then the data must already be in the proper order so the program should terminate, if swap have been made the at least one more pass is needed.

Q3) Write a single statements that perform the following single-subscripted

array operations

a) Initialize the 10 element of integer array counts to zeros

b) Add 1 to each of the 15 element of integer array bonus.

c) Read 12 values for float array monthlytemperatures from the keyboard

d) Print the value 5 of integer array bestscores in column format

Q4) Use the double subscripted array to solve the following problem. A company has four sales people

who sell 5 different products, once each day each sales person passes in a slip for different

You May Also Find These Documents Helpful

  • Better Essays

    Arrays An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created. After creation, its length is fixed. You've seen an example of arrays already, in the main method of the "Hello World!" application. This section discusses arrays in greater detail. Each item in an array is called an element, and each element is accessed by its numerical index. As shown in the above illustration, numbering begins with…

    • 1094 Words
    • 5 Pages
    Better Essays
  • Good Essays

    7 and Array

    • 500 Words
    • 2 Pages

    1. An array is a list of data items that _____. are of different data types are all integers have different names are indexed | 2. An array that stores five days of closing stock prices can be declared as _____. decimal price1, price2, price3, price4, price5; decimal [] price = new decimal[5]; decimal price[] = new decimal[5]; decimal [] price = new price[5]; | 3. Which statement is true about this array declaration? int [] myArray = {1,4,3,5,6}; It declares a 5 dimensional array…

    • 500 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Net Present Value/Present Value Index The management team at Savage Corporation is evaluating two alternative capital investment opportunities. The first alternative, modernizing the company’s current machinery, costs $45,000. Management estimates the modernization project will reduce annual net cash outflows by $12,500 per year for the next five years. The second alternative, purchasing a new machine, costs $56,500. The new machine is expected to have a five-year useful life and a $4,000…

    • 2574 Words
    • 11 Pages
    Powerful Essays
  • Satisfactory Essays

    Arrays

    • 843 Words
    • 4 Pages

    Student Name | | Class | Comp230 | Date | 03/04/2013 | Windows CLI Commands Lab Report NOTE: Please use Carriage Returns and Page Breaks as needed to prevent box contents from extending across page boundaries. Task 1: Displaying IP Configuration Settings Open the Windows Command Prompt using the desktop or the Taskbar icon. Maximize the size of the CLI. Use the ipconfig /all command to determine the following IP configuration settings for “Wired” Ethernet NIC: IP Address: | 169…

    • 843 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Array Representation

    • 338 Words
    • 2 Pages

    Array Representation A complete binary tree has a simple array representation. Suppose we number the nodes from left to right, beginning at the top and ending at the bottom. Then we can store the various data items in the corresponding elements of an array. For example can be represented by the array This in fact corresponds to the level order enumeration of the tree. Note that we only use an initial segment of the array. Provided the array is long enough, and we know the number of…

    • 338 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    IP Array

    • 644 Words
    • 5 Pages

    Date VBScript IP Array Report In the space provided below, copy and paste your IP_Array.vbs Program Code. If it doesn’t fit, use the next page for the continuation of your sourcecode program ' VBScript: IP_Array.vbs ' Written by: Student Name ' Date: Today's Date ' Class: COMP230 ' Professor: Professor Name ' =================================== ' Below is an initialize a 2-dimension ' array of IP Address. The first index ' +100 is the room# and the second index ' +1 is the computer# in…

    • 644 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    CARBON6 9 2 0 1 4

    • 1661 Words
    • 9 Pages

    CARBON 6 9 ( 2 0 1 4 ) 6 3 8 –6 4 0 Available at www.sciencedirect.com ScienceDirect journal homepage: www.elsevier.com/locate/carbon Letter to the Editor Carbon nanodots with strong nonlinear optical response Dezhi Tan a, Yuya Yamada b, Shifeng Zhou c, Yasuhiko Shimotsuma b, Kiyotaka Miura b, Jianrong Qiu a,c,* a State Key Laboratory of Silicon Materials, Department of Materials Science and Engineering, Zhejiang University, Hangzhou, Zhejiang 310027, PR China b Department of Material Chemistry…

    • 1661 Words
    • 9 Pages
    Good Essays
  • Satisfactory Essays

    C# String Functions

    • 325 Words
    • 2 Pages

    C# String Functions 1. Concat - Concatenates two specified instances of String. 2. Contains - Returns a value indicating whether the specified String object occurs within this string. 3. EndsWith - Determines whether the end of this string instance matches the specified string. 4. Equals - Determines whether this instance and another specified String object have the same value. 5. Format - Replaces one or more format items in a specified string with the string representation of…

    • 325 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    notes on arrays

    • 326 Words
    • 2 Pages

    DERIVED DATA TYPES: REFERENCES, ARRAYS AND POINTERS Krishna M. Singh Department of Mechanical and Industrial Engineering Indian Institute of Technology Roorkee Roorkee 247667 Reference: Deitel and Deitel. C++ : How to Program. Prentice Hall, 2008 Krishna M. Singh, Department of Mechanical & Industrial Engineerig, IIT-Roorkee 1 Fundamental Data Types Basic Types: Boolean, character, integer and floating point types. Additional Types: void : To signify absence of information…

    • 326 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    PRINT THIS PLS

    • 1343 Words
    • 6 Pages

    develop and maintain wellness. Physical Fitness is a combination of medical fitness (body soundness) and dynamic fitness (capacity for action). A physically fit person is free from disease and can move and perform efficiently. Neither good health nor physical proficiency alone constitutes physical fitness, which combines both qualities. It is the primary specific objective in teaching Physical Education. It is the ability of an individual to perform one’s daily activities efficiently without undue…

    • 1343 Words
    • 6 Pages
    Better Essays