Preview

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
Open Document
Open Document
763 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
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)
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

  • Satisfactory Essays

    a. The time in hours, minutes, and seconds is to be passed to a function named totsec().…

    • 720 Words
    • 3 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
  • Better Essays

    Nt1310 Unit 4

    • 3614 Words
    • 15 Pages

    The program is trying to collect the value of a "void" function into an integer variable.…

    • 3614 Words
    • 15 Pages
    Better Essays
  • Satisfactory Essays

    1. Who is the company? Provide information about the age, location and type of business.…

    • 3274 Words
    • 11 Pages
    Satisfactory Essays
  • Powerful Essays

    The purpose of this Lab. is to familiarize student how to solve practical problems programmatically; they will practice on elementary programming using primitive data types, variables, constants, operators, expressions, and input and output. Also, they will learn how to diagnose errors that may occur when a program is compiled or executed. There are some exercises, through which they will understand the concept learn in this chapter.…

    • 2338 Words
    • 10 Pages
    Powerful Essays
  • Good Essays

    The director of staffing for the organization was asked to come up with a staffing strategy to fill the 35 new positions that are needed in this department. The director came up with a four-step plan to fill these jobs. The director decided on:…

    • 617 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Sales and Cell

    • 445 Words
    • 2 Pages

    | In cell G21, enter a function to find the lowest value in the range H5:H16.…

    • 445 Words
    • 2 Pages
    Good Essays
  • Better Essays

    JOT2 TASK 1 Raveed

    • 1219 Words
    • 2 Pages

    be sold en­masse over a course of a three day period. Consignors receive revenue from their…

    • 1219 Words
    • 2 Pages
    Better Essays
  • Good Essays

    unit 8 homework

    • 793 Words
    • 5 Pages

    3. Design a For loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 . . . 1000…

    • 793 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    6. Press STAT which option will sort data in ascending order? What do you think will happen if option 3 is selected? __________________________________…

    • 641 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Mktg 301

    • 4364 Words
    • 18 Pages

    Substitute 19 for the number of sales people working in the equation found in the previous step and solve for Sales.…

    • 4364 Words
    • 18 Pages
    Satisfactory Essays
  • Satisfactory Essays

    5.) Design a While loop that lets the user enter a number. The number should be multiplied by 10, and the result stored in a variable named product. The loop should stop once product contains a value > 100.…

    • 651 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Chapter 8 Quiz

    • 469 Words
    • 2 Pages

    5. Which of the following arguments must be passed when passing an array as an argument? (Points : 6)…

    • 469 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Hospital and Square Feet

    • 389 Words
    • 2 Pages

    “Indeed, Allah will not change the condition of a people until they change what is in themselves.” (Al-Quran 13:11)…

    • 389 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Java

    • 490 Words
    • 3 Pages

    Write a Java program to demonstrate using bitmaps and bitwise operators to sort and remove duplicates from a file of random phone numbers. Do not confuse the term bitmap used for compressing data into smaller spaces with the bitmap that has come to mean a graphic image.…

    • 490 Words
    • 3 Pages
    Good Essays

Related Topics