Thread: C programming with codeblocks

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    3

    C programming with codeblocks

    I am in a c programming class and i have no idea how to do the stuff. The teacher wants us to write a program that does basic vector operations. The program needs to: Prompt the user to enter the x,y,and z values for two vectors a and b and store them in array.
    Ask the user what operation he would like the program to perform.
    The program should perform one of the following add vectors, find the dot product, find the cross product of axb,adn find the angle between them.
    The program should display the value requested by the user, or display an error message if the user enters something wrong.
    Must use a loop for at least one of the operations, and your vectors must be stored as arrays. Please if anyone can will you show me how to perform this program.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    So start with the part where you prompt for three variables.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by caleb kennedy View Post
    I am in a c programming class and i have no idea how to do the stuff. The teacher wants us to write a program that does basic vector operations. The program needs to: Prompt the user to enter the x,y,and z values for two vectors a and b and store them in array.
    Ask the user what operation he would like the program to perform.
    The program should perform one of the following add vectors, find the dot product, find the cross product of axb,adn find the angle between them.
    The program should display the value requested by the user, or display an error message if the user enters something wrong.
    Must use a loop for at least one of the operations, and your vectors must be stored as arrays. Please if anyone can will you show me how to perform this program.
    So you found a professor who expects you to use concepts he hasn't taught in class?

    or

    Did you not pay attention in class, perhaps due to a lack of corporeal presence?

    Just follow each step as its written and solve that sub problem.

    Quote Originally Posted by YOUR homework not mine
    The program needs to: Prompt the user
    Sounds like a job for printf()
    to enter the x,y,and z values
    hmm, sounds like you are scanf() ing for 3 inputs, X, Y and Z
    for two vectors a and b
    wow this sounds like an awesome place to use a loop
    and store them in array.
    Hey I read the future.
    Ask the user what operation he would like the program to perform.
    more scanf() and maybe a switch statement
    The program should perform one of the following add vectors, find the dot product, find the cross product of axb,adn find the angle between them.
    Ill leve this up to you.
    The program should display the value requested by the user, or display an error message if the user enters something wrong.
    default:
    Must use a loop for at least one of the operations, and your vectors must be stored as arrays.
    again, I read the future.

    Please if anyone can will you show me how to perform this program.
    Homework Policy

    Show us what you have already tried and we can give you TEXT("pointers") as to why it's not working as expected.
    Last edited by abachler; 09-24-2009 at 09:37 PM.

  4. #4
    Registered User
    Join Date
    Sep 2009
    Posts
    3

    Thanks

    Thank you. I have been in class everyday but one. I have asked him but he can't explain how. He is an undergrad and teaching is not his ability.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. library issues in CodeBlocks
    By everlearnin in forum C++ Programming
    Replies: 0
    Last Post: 06-02-2009, 08:44 PM
  2. Codeblocks crashes linux?
    By Shakti in forum Tech Board
    Replies: 1
    Last Post: 03-25-2009, 07:26 AM
  3. Code::Blocks doesn't like my enums and typedefs
    By muehl in forum C++ Programming
    Replies: 19
    Last Post: 02-12-2009, 10:48 AM
  4. Problem With std::string in Codeblocks.
    By ThLstN in forum C++ Programming
    Replies: 4
    Last Post: 08-24-2008, 11:01 AM
  5. Replies: 1
    Last Post: 01-11-2008, 09:34 AM