Assignment No.  1
Semester: Fall 2023

CS201 – Introduction to Programming

Instructions

Please read the following instructions carefully before submitting assignment:

It should be clear that your assignment will not get any credit if:

 

o        Assignment is submitted after due date.

o        Submitted assignment does not open or file is corrupt.

o        Assignment is copied (From internet/students).

o        Assignment is submitted in any file format other than .cpp.

 

Recommended tool to develop Assignment

-          Dev C++

 

Objectives:

To enable students to understand and practice the concepts of:

  • Loops
  • Function

 

Assignment Submission Instructions

You must submit only.cpp file on the assignments interface of CS201 from your LMS account. Assignment submitted in any other format will be scaled with zero mark. So, check your solution file format before submission.

Write a C++ program that performs the following tasks:

Use only the provided Student ID: BC123456789(In case of not using this ID, marks will be deducted.)

 

Your program must take the numerical part of the given Student ID BC123456789 which is 123456789.

·         Save the numerical part of the given ID in a variable.

·         Double (Multiply by 2) each digit and print each doubled digit in reverse order.

·         Calculate sum of all the doubled digits.

·         Print the sum on screen.

 

Your program should use functions to complete the above tasks. You will define doubleDigits() function which will double of each digit and print, and sumOfDoubledDigits () function to calculate the sum of the doubled digits.

 Solution:

https://wa.me/923077317934

Download File

Code in .cpp

Previous Post Next Post