C++ Basic Syntax – Homework Exercises

Slides:



Advertisements
Similar presentations
10-6 Solving Quadratic Equations by Factoring
Advertisements

Solving Quadratic Equations Tammy Wallace Varina High.
Solve by taking roots. Warm up. Homework Review Skills Check.
Implementing Control Logic in C# Svetlin Nakov Telerik Corporation
5.5 Solving Quadratic Equations by Factoring
Solving Quadratic Equations Section 1.3
Bell Work: Find the values of all the unknowns: R T = R T T + T = 60 R = 3 R =
6.5 – Solving Equations with Quadratic Techniques.
Lesson 9-2 Pages The Real Number System Lesson Check 9-1.
Solving Equations. A quadratic equation is an equation equivalent to one of the form Where a, b, and c are real numbers and a  0 To solve a quadratic.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Using the factoring method, what are the solutions of y = x 2 + 5x + 6.
1.6 Loops academy.zariba.com 1. Lecture Content 1.While loops 2.Do-While loops 3.For loops 4.Foreach loops 5.Loop operators – break, continue 6.Nested.
1.3 Console Input And Output academy.zariba.com 1.
The Quadratic Formula. What does the Quadratic Formula Do ? The Quadratic formula allows you to find the roots of a quadratic equation (if they exist)
Solving Quadratic Equations by Factoring Solve quadratic equations by factoring. Solve other equations by factoring
Warm-Up Change each decimal to a fraction:
Chapter 10 Section 3 Solving Quadratic Equations by the Quadratic Formula.
Notes Over 7.1 no real 4th roots Finding nth Roots
Graph and on a number line. Then copy and complete the statement with, or Example 2 Comparing Real Numbers 1 ? = SOLUTION Use a calculator.
Solving Equations by Factoring Definition of Quadratic Equations Zero-Factor Property Strategy for Solving Quadratics.
§ 3.6 Solving Quadratic Equations by Factoring. Martin-Gay, Developmental Mathematics 2 Zero Factor Theorem Quadratic Equations Can be written in the.
What you will learn How to solve a quadratic equation using the quadratic formula How to classify the solutions of a quadratic equation based on the.
5.3 – Solving Quadratic Equations by Factoring. Ex. 1 Solve y = x 2 + 5x + 6 by factoring.
Solving Quadratic Equations. Review of Solving Quadratic Equations ax 2 +bx +c = 0 When the equation is equal to zero, solve by factoring if you can.
The Quadratic Formula Students will be able to solve quadratic equations by using the quadratic formula.
Chapter 10 Section 1 Square Root Property. Learning Objectives Know that every positive real number has two square roots. Solve quadratic equation using.
Solve by taking roots. Warm up. Homework Review Completing the Square.
Advanced Functions SET 153L. Logical Function An IF function can place different values in a cell based on some condition. =IF (test, value if true, value.
4.9: Graph and Solve Quadratic Inequalities Objectives: Solve quadratic inequalities by using tables and graphs. Solve quadratic inequalities by using.
Warm up Solve by taking roots..
C++ Memory Management – Homework Exercises
Sem Exam Review Test: Solving
Do Now Use the standard form of a quadratic equation to find the a, b and c of each equation. ax2 + bx + c = 0 x2 – 6x + 10 = 0 2x2 + 3x + 4 = 0 x2 –
4.6 Quadratic formula.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Square Root Method Trinomial Method when a = 1 GCF
7.3 Solving Equations Using Quadratic Techniques
Solving Equations by Factoring
PLEASE GET OUT A SHEET OF PAPER AND SET IT UP FOR CLASS NOTES!!!!
Copyright 2013, 2010, 2007, 2005, Pearson, Education, Inc.
4.6 Quadratic formula.
Review for Test: Solving
Lucan Community College Leaving Certificate Mathematics
5.6 – The Quadratic Formula And Ch 5 Review
SOLVING QUADRATIC EQUATIONS USING THE FORMULA
The Quadratic Formula.
CS1100 Computational Engineering
Quadratic Equations by Dr. Terri
Section 11.1 Quadratic Equations.
1B.1- Solving Quadratics:
Solving Quadratic Equations
The Square Root Property and Completing the Square
Factoring GCF and DOTS.
Objective Solve quadratic equations by graphing.
Standard Form Quadratic Equation
Solving Equations involving Decimal Coefficients
Warm-Up 5 minutes Factor the following expressions: 2) x2 - 3x
Chapter 6 Section 5.
Homework Check.
Solving Polynomials by Factoring
Algebra 1 Section 12.3.
3.4 Solve by Factoring (Part 1)
Exercise Solve x – 14 = 35. x = 49.
2.3 Factor and Solve Polynomial Expressions
Skills Check Factoring (after the HW Check)
Programming Fundamental-1
quadratic formula. If ax2 + bx + c = 0 then
Lecture 17 – Practice Exercise 3 SOLUTIONS
Homework Check.
Presentation transcript:

C++ Basic Syntax – Homework Exercises Write C++ code for solving the tasks on the following slides Code should compile under the C++03 or the C++11 standard Please submit only the .cpp files for these exercises Each exercise should be a separate .cpp file, named with the exercise number followed by what you feel describes the exercise in a few words E.g. a good name for exercise 2 of this homework would be 2.product-sign.cpp or 2.show-product-sign.cpp, 2.sign.cpp is also acceptable Don’t worry about the name too much, just make sure the number and the file extension are correct

Exercises Write a conditional statement that examines two integer variables and exchanges their values if the first one is greater than the second one. Write a program that shows the sign (+ or -) of the product of three real numbers without calculating it. Use a sequence of if statements. Write a program that enters the coefficients a, b and c of a quadratic equation a*x2 + b*x + c = 0 and calculates and prints its real roots. Note that quadratic equations may have 0, 1 or 2 real roots.

Exercises Write a program that prints all the numbers from 1 to N Write a program that reads from the console a sequence of N integer numbers and returns the minimal and maximal of them Write a program that calculates the greatest common divisor (GCD) of given two numbers. Use the Euclidean algorithm (find it in Internet) Write a program that calculates for given N how many trailing zeros present at the end of the number N!. Examples N = 10, N! = 3628800, answer 2; N! = 2432902008176640000, answer: 4. Make sure your program works for N up to 50 000

Exercises Write a function that reverses the digits of given positive decimal number. Example: 256  652 Write a bool function that tests the function from task 8 with different values. It should call the function from 8 for a value and check the result against the expected answer. Make the function check at least 10 numbers of different length and return true if all were correct or false if any of them was wrong. Call that this checking function from main() and print it’s result For this task, you are NOT allowed to use any type of loop. Write a function that calculates the Nth Fibonacci number.