{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab Assignment 2

Lab Assignment 2 - Objectives String concatenation and...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab Assignment 2 Objectives: String concatenation and constant reuse Using predefined libraries Formatting output, casting, and overloaded division Program 1: Concatenate, aka Lab2Pgm1 Although this is somewhat similar to the first program from Lab 1, it has some additional requirements. You should have two named string constants – one containing “Greetings “, and one containing “.\n”. You will need to use unnamed strings “from “ and “to “. You will need to ask the user for two variable strings, “Please enter receiver name: “, and sender. Your output will consist of two strings cconcatenated from the above six strings with the named strings used twice. Program 2: Power calculation, aka Lab2Pgm2 The user enters two numbers, for example, base = 5 , and power = 4 . The program repeats the input and calculates base power using the <cmath> library function pow() . For the example, the output should be 625. Program 3: Divider, aka Lab2Pgm3 The user enters two numbers, for example, num1 = 5, num 2 = 3, and perfoms the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}