Suggested Projects

 < Day Day Up > 



  1. Matrix Multiplication: Given two matrices Aij and Bjk the product Cik can be calculated with the following equation:

Write a program that multiplies the following matrices together and stores the results in a new matrix. Print the resulting matrix values to the screen.

  1. Calculate Class Averages: Computer Write a program that computes class averages. Allow the user to set the size of the array of floats based on class size. Prompt the user for each grade. Average the grades and print the results to the screen.

  2. Number Counter: Write a program that counts the number of times a user enters a particular number between the values 1 through 20. Exit the program when the user enters a number outside that range. Before the program exits, print a histogram to the screen showing the distribution of the numbers entered by the user. The histogram may look something like this...

    1:** 2:********* 3: 4:**    .    .    . 20:*****

    ...indicating the number 1 was entered two times, the number 2 was entered nine times, etc.

  3. String Reader: Write a program that reads a string from the user of arbitrary length and counts the number of times each letter of the alphabet appear in the string. Print a histogram to the screen showing the results.

  4. Command Line Echo: Write a program that echoes command line arguments by implementing the main(int argc, char *argv[]){} function. The argc argument is a count of the number of command line arguments with which the command was evoked. It includes the command itself so the value of argc will at least be 1 and will equal 1 in the absence of any command line arguments. The argv argument is an array of char pointers, each pointing to a particular command line string. For example, if the name of the program was echo_args then the following command line...

    [localhost:~] swodog% echo_args This works great!

    ...would result in argc = 4, and argv[0] = “echo_args”, argv[1] = “This”, argv[2] = “works”, and argv[3] = “great!”.



 < Day Day Up > 



C++ for Artists. The Art, Philosophy, and Science of Object-Oriented Programming
C++ For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504028
EAN: 2147483647
Year: 2003
Pages: 340
Authors: Rick Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net