Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: im new to c++  (Read 5019 times)

0 Members and 1 Guest are viewing this topic.

rubiv89

    Topic Starter


    Starter

    • Experience: Beginner
    • OS: Unknown
    im new to c++
    « on: February 04, 2011, 05:36:53 PM »
    trying to figure out how i would start this problem

    Given the equations shown below, the values of x and y can be found using Cramer's Rule.

                                       ax + by = c
                  dx + ey = f

    Cramer's Rule says that determinants can be used to calculate the values of x and y as follows:

      Cramer x formula        Cramer y formula

    To calculate the determinant of a 2 x 2 matrix, cross multiply and subtract the products. For example, the determinant of
                                sample matrix
    is (5 * 6 - 3 * 4) = 18

    Write an interactive C++ program that uses Cramer's Rule to solve a pair of linear equations. The program should prompt for 6 integer values that represent the 6 unknowns, a-f.

    As output,

        * display your name, section #, and the assignment # AFTER the prompts for input
        * display the 2 equations and the values of x and y with appropriate labels (see sample terminal session below)

    Requirements

        * program must read a, b, c, d, e, and f in that order (separate prompts are not necessary)
        * a, b, c, d, e, and f must be declared as integers and displayed as integers
        * x and y should be declared as double type values (may include decimals)
        * your name, section #, and assignment # must be displayed after the input values have been read and before the equations are output
        * when displaying the equations, make sure there is exactly 1 blank space between the terms and operators (see sample terminal session)
        * the equations and x and y values should be displayed on separate lines
        * let the computer use its default settings for displaying x and y (do not set precision)

    NOTE: You may assume that the determinant of the denominator will NOT be equal to zero.

    Sample terminal session and output:
    [lee@bobby]$ g++ hw03.cpp
    [lee@bobby]$ ./a.out
    Please enter integer value for a
    4
    Please enter integer value for b
    6
    Please enter integer value for c
    4
    Please enter integer value for d
    2
    Please enter integer value for e
    -9
    Please enter integer value for f
    -2

    Lee Misch   Section #100_   Assignment #3
    4x + 6y = 4
    2x + -9y = -2
    x = 0.5
    y = 0.333333
     ??? ???

    Khasiar



      Intermediate

      Re: im new to c++
      « Reply #1 on: April 18, 2011, 12:09:05 AM »
      this is really easy, and looks to be homework, try do it on your own and if you get stuck ask for help, if you want us to do it for you then why are you even studying programmign?

      jckjones29



        Greenhorn

        • Experience: Beginner
        • OS: Unknown
        Re: im new to c++
        « Reply #2 on: April 19, 2011, 01:24:48 PM »
        Hello,
        C++ is a programming language.It is combined of console and oops concept.Object oriented programming (OOP) have taken the best ideas of structured programming and combined them with several powerful new concept that encourage you the approach the task of programming in a new way.

        rubiv89

          Topic Starter


          Starter

          • Experience: Beginner
          • OS: Unknown
          Re: im new to c++
          « Reply #3 on: October 03, 2014, 10:46:12 PM »

          ...

          DaveLembke



            Sage
          • Thanked: 662
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 10
          Re: im new to c++
          « Reply #4 on: October 12, 2014, 10:06:56 AM »
          welcome back after 3 years missing ....  ;D

          Maybe the aliens are sending people back finally after abductions here.  :P

          Geek-9pm


            Mastermind
          • Geek After Dark
          • Thanked: 1026
            • Gekk9pm bnlog
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 10
          Re: im new to c++
          « Reply #5 on: December 03, 2014, 10:27:37 PM »
          welcome back after 3 years missing ....  ;D

          Maybe the aliens are sending people back finally after abductions here.  :P
          DaveLembke,
          Alien abduction?
          Did you mean the OP?
          OR
          Are you refereeing yourself?  ;D