We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Assignment No.  1
Semester: Spring 2017

CS201 – Introduction to Programming

 

Total Marks: 20

 

Due Date: 4 May 2017

 

 

Instructions

Please read the following instructions carefully before submitting assignment:

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

 

  • Assignment is submitted after due date.
  • Submitted assignment does not open or file is corrupt.
  • Assignment is copied (From internet/students).

 

Software allowed to develop Assignment

-          Dev C++

 

Objectives:

To enable students to write, compile and execute a program in DevC++. Moreover to familiarize students with  the concepts of:

  • Variables and operators
  • Expressions in C++
  • Decision structures
  • Repetition structures
  • Break and Continue statements

 

 

Assignment Submission Instructions

You have to submit only.cpp file on the Assignments interface of CS201 at VULMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.

 

Assignment

 

 

Write a program that will ask the user to enter lower limit and upper limit in form of integers. The program will calculate and show the prime numbers within the range from lower limit to upper limit. All the prime numbers within the specified range should be displayed on the output. The program should also aggregate all the prime numbers within the range and show their sum as well. Also show the total number of prime numbers within the specified range.

 

Make sure that the user should not be able to enter a negative value or a value less than 2. Also the value entered as lower limit should not be greater than the upper limit.

 

 

 

 

Sample output for correct input:

 

 

Sample output for the wrong input:

 

 

Sample output for the wrong input:

 

 

 

 

 

 

 

Deadline:

The deadline to submit your assignment solution is 4th May, 2017. Your assignment must be submitted within the due date through VULMS. No assignment will be accepted through email after the due date.

 

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 2379

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Attachments:

Replies to This Discussion

#include <iostream>
using namespace std; 


int main() 
{

int lowerLimit,sum,upperlimit,numberofPrimeNumbers;

sum = 0;
numberofPrimeNumbers =0;

cout "Please enter a LowerLimit.....:"; 
cin >> lowerLimit; 
cout "Please enter an UpperLimit.....:";
cin >> upperlimit;

if(lowerLimit > 2)
{


if(lowerLimit < upperlimit)
{

cout "\n\nPrime numbers between the range are : "endl; 

for(int i = lowerLimit; i <= upperlimit; i++) 
{
bool isPrime=true;

for(int j = 2; j <= i / 2; ++j) 
{
if(i % j == 0) 
{
isPrime = false;
break;
}
}
if (isPrime) 
{

couti" ";
numberofPrimeNumbers++; ////// add count 
sum+=i; ////////sum prime number
}

}

cout "\n\nTotal number of prime numbers between the range are : " numberofPrimeNumbersendl;
cout "Sum of the prime numbers between the range is : " sumendl;

}
else 
{
cout "Lower Limit can not be greater then or equal to the Upper Limit!"; 
}

}
else
{
cout "Lower Limit can not be less then 2!";

}

return 0;

}

i hv tried this prog but it is not working

assignment solution

Attachments:

IS THIS RIGHT

on providing upper limit and pressing enter the box disappears, Why it is so?

same prob here

assalam o alaikum! is this assignment is right

Is it authentic bro?

Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....

Assignment cs201 

Attachments:

RSS

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.