SlideServe
Menu
Préférences
© SlideServe · v2026

Engineering Problem Solving With C++ An Object Based Approach

mayda avatar
12 diapositives · 295 Views · Jul 13, 2014

Engineering Problem Solving With C++ An Object Based Approach. Fundamental Concepts Chapter 1 Engineering Problem Solving. Objectives. Understand basic components of a computers. Understand a problem-solving methodology for solving engineering problems with a computer.

Engineering Problem Solving With C++ An Object Based Approach - slide 1
01 / 12Engineering Problem Solving With C++ An Object Based Approach
1 / 17

Télécharger la présentation

Engineering Problem Solving With C++ An Object Based Approach
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Engineering Problem Solving With C++An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving

  2. Objectives • Understand basic components of a computers. • Understand a problem-solving methodology for solving engineering problems with a computer.

  3. Computer hardware and software • A computer is a machine designed to perform operations specified with a set of instructions called a program. • Hardware refers to the computer equipment. • keyboard, mouse, terminal, hard disk, printer • Software refers to the programs that describe the steps we want the computer to perform.

  4. Computer hardware Internal Memory External Memory ALU: Arithmetic Logic Unit CPU: Central Processing Unit Control Output Input ALU CPU

  5. 01010101 11110000 10001000 00010001 Main Memory 0 • Main Memory - • Terminology: • Main memory is divided into numbered locations called bytes. • A byte is a sequence of 8 bits. • A bit is a binary digit (0 or 1). • The location number associated with a byte is called the address. • A group of consecutive bytes is used for storing the binary representation of a data item, such as a number or a character. • What value is represented by the 4th byte? 1 2 3

  6. Computer Software • Operating System - Provides an interface with the user • unix, windows, linux, ... • Software Tools • word processors (MS Word, WordPerfect, ...) • spreadsheet programs (Excel, Lotus1-2-3, ...) • mathematical computation tools (MATLAB, Mathematica, ...) • Computer Languages • machine language • assembly language • high level languages (C, C++, Ada, Fortran, Basic, java)

  7. Input data Machine language program Program output Compile Link/load Execute C++ language program Executing a Computer Program • Compiler • Converts source program to object program • Linker • Converts object program to executable program

  8. Key Terms • Source Program • printable/Readable Program file • Object Program • nonprintable machine readable file • Executable Program • nonprintable executable code • Syntax errors • reported by the compiler • Linker errors • reported by the linker • Execution/Run-time errors • reported by the operating system • Logic errors • not reported; You may see it in the output generated

  9. Basic Program Structure • /******************************************** • * Header Comments • ********************************************/ • include files • global declarations • int main() • { • declarations and executable statements • return 0; • }//end block of main

  10. An Engineering Problem Solving Methodology 1. PROBLEM STATEMENT 2. INPUT/OUTPUT DESCRIPTION 3. HAND EXAMPLE 4. ALGORITHM DEVELOPMENT 5. TESTING

  11. 9.5 20.75 Sample Pseudo Code 1. Write a program to compute the volume of box. 2. Input: length, width, height Output: volume 3. Hand Example: volume = 20.75*11.5*9.5 4. Algorithm: input length, width and height compute volume output volume 5. Implement algorithm in C++ and test. 11.5

  12. /************************************************************//************************************************************/ /* Program chapter1 */ /* */ /* This program computes the volume of a box */ /************************************************************/ #include <iostream> using namespace std; int main() { // Declare and initialize objects double length( 20.75), width(11.5),height(9.5), volume; // Calculate volume. volume = length * width * height; // Print the volume. cout << “The volume is “ << volume << endl; // Exit program. return 0; } /************************************************************/