COS120HomeWork_2 -...

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

View Full Document Right Arrow Icon
2c728475958afd8cbfeafd08e6ed35d7b330b07f.doc Page 1 of 2 COS120 Software Development Using C++ Homework 2 Functions Don’t forget: Paper record to be presented before the end of next class Tasks: Write a driver program to test user defined function digits() that finds the K-th (from right to left) digit of a given number N. The function should take two arguments of type int and return the digit as an int . Comment lines to be inserted. Examples: N=123456 K=2 Result: 5 N=1234 K=3 Result: 2 Define a function star() with one integer argument N that displays N stras in one line on the screen. Example: N=5 Result: ***** Write a program that uses function star() to display on the screen the following output: * ** *** **** Hint: Write appropriate number of comment lines. Prepare, Please the paper record using the following template for the header page: COS120 Software Development Using C++ Student:Ivalina Petrova Homework Nmr 02 (Functions) Tasks:
Background image of page 1

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

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

Page1 / 2

COS120HomeWork_2 -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online