Thread: Equation solver homework

  1. #1
    Registered User
    Join Date
    Jan 2021
    Posts
    4

    Post Equation solver homework

    Write a programm in C to implement following senario:
    you are required to design a solution for physics student to calculate equation of mottion.if the user enters 1,he can calculate first equation of motion.if he enters 2,he can calculate second equation of motion and if he enters 3 he can calculate third equation of motion using his desired data values.
    you are required to use functions and switch stement to implement the secanario.
    three equations are:
    1.v=u+at
    2. s=ut+1/2at^2
    3.v^2-u^2=2as
    where v=final velocity
    u=initial velocity
    a=acceleration
    t=time

    can anyone solve this promblem?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,484
    OK, so what are you stuck on?

    Do you know what this means?
    Code:
    scanf("%d",&choice);
    if ( choice == 1 ) {
        printf("Solver for v=u+at\n");
    }
    Can you complete it for the two other cases?

    Can you prompt for the appropriate initial values in each case?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jan 2021
    Posts
    4
    i donot understand how to solve this?can you solve this for me?
    Last edited by alifaraz; 01-03-2021 at 10:22 AM.

  4. #4
    Registered User
    Join Date
    Jan 2021
    Posts
    4
    to solve this promblem we have to implement secnario and use function and switch statement instead of if-else statement.
    Last edited by alifaraz; 01-03-2021 at 10:29 AM.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,484
    We're not here to just do all of your work on demand.

    You need to study your course notes / books / whatever and try and make a start.
    Sure you'll mess up - that's why it's called learning.

    To give up and post a "feed me" without even trying is your fast lane to failure.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Jan 2021
    Posts
    4
    ok thank you for telling me i donot know about that
    sorry i donot demand from you i just requested to you that please solved this promblem.
    because i tried to solve but i didn,t solve that promblem
    Last edited by alifaraz; 01-04-2021 at 05:54 AM.

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    3,970
    Introduction to C - Cprogramming.com

    Post your code! If you have build errors post the errors!

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linear Equation Solver
    By EvilGuru in forum C++ Programming
    Replies: 7
    Last Post: 10-22-2005, 10:10 AM
  2. Quadrtic equation solver with graphics.
    By joeyzt in forum Windows Programming
    Replies: 18
    Last Post: 07-20-2003, 02:35 PM
  3. IDEA: Equation solver
    By Magos in forum Contests Board
    Replies: 2
    Last Post: 01-07-2003, 11:46 AM