Thread: How to write a C program that will Calculate stress

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    10

    How to write a C program that will Calculate stress

    I recently signed up for ES201 class and am confused with how to compile a program in the C language that will convert ACT scores to SAT scores.
    And sorry for the false thread title posted the one for the code I need to compile.
    Last edited by dmcarpenter; 02-07-2013 at 07:12 PM.

  2. #2
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Welcome to the forum!

    What are you confused about? The C language, the development process, or the formula in which the Stress is calculated?

    What have you tried so far?
    Fact - Beethoven wrote his first symphony in C

  3. #3
    Registered User
    Join Date
    Feb 2013
    Posts
    10
    I'm having problems with the development process of how to integrate the stress equation into a code.....
    Below is what I've tried so far....Being as how I am new to this concept I'm sure it need many corrections.
    Code:
    ACT TO SAT
    /////////////
    
    #include <stdio.h>
    
    main() {
      double ACTmath;
      double ACTenglish;
      double SATmath;
      double SATverbal;
    
      printf("Enter the ACT scores: ");
      scanf("&lf%lf", &ACTmath, &ACTenglish);
    
      SATmath = 12.118 + 22.096/10;
      SATverbal = -22.367 + 20.763/10;
    
      printf("SAT score is: %g\n", SATmath, SATenglish);
    
    }

  4. #4
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    In plain English, write down what you need to do

    i.e.
    Get ACT score for math,
    ....
    Use formula y = mx + c ...
    print out SAT score for...

    It will also help us work out what you are doing
    Fact - Beethoven wrote his first symphony in C

  5. #5
    Registered User
    Join Date
    Feb 2013
    Posts
    10
    The two equations used to convert ACT scores to SAT scores are below:
    SAT(math) = 12.118 + 22.096(ACT math)
    SAT(verbal) = -22.267 + 20.763(ACT english)

    I have to use these equations in my code I'm going to compile and the results have to be rounded to the nearest multiple of ten. So to sum it up I have to compile and run a program that can convert ACT scores to SAT scores.
    Last edited by dmcarpenter; 02-07-2013 at 07:13 PM.

  6. #6
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    You are not multiplying 22.096 by ACT math in your code, you are dividing 20.096 by 10.

    This might help you
    Introduction to C - Cprogramming.com
    Fact - Beethoven wrote his first symphony in C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Handling work stress
    By Epy in forum General Discussions
    Replies: 21
    Last Post: 12-12-2011, 07:16 PM
  2. Hopelessly Lost (calling file, write to value, calculate)
    By DJPlayer in forum C++ Programming
    Replies: 5
    Last Post: 11-13-2007, 12:36 PM
  3. Overwhelming Stress
    By Krak in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 10-27-2003, 08:55 PM
  4. Program to Calculate Pi
    By zowen in forum C++ Programming
    Replies: 1
    Last Post: 10-11-2003, 11:18 AM
  5. Paintball: The solution to stress
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 61
    Last Post: 08-18-2003, 12:51 AM