Question 2: Encryption is a process to secure your data. Caesar Cipher is one of the method to encrypt the data. In this method we need a key to encrypt data. Now using that key one character is replaced with another one. [small or capital alphabets are allowed, otherwise invalid input] Write a C++ program in which, read a character and an integer key from user. Now encrypt the character using given key. Example 1: Sample input: Example 2: Sample input: Example 3: Sample input: Enter a character: @ Enter a character: a Enter a character: Z Enter key: 3 Sample output: Encrypted character is: d Enter key: 3 Sample output: Encrypted character is: C Enter key: 3 Sample output: Invalid input
Question 2: Encryption is a process to secure your data. Caesar Cipher is one of the method to encrypt the data. In this method we need a key to encrypt data. Now using that key one character is replaced with another one. [small or capital alphabets are allowed, otherwise invalid input] Write a C++ program in which, read a character and an integer key from user. Now encrypt the character using given key. Example 1: Sample input: Example 2: Sample input: Example 3: Sample input: Enter a character: @ Enter a character: a Enter a character: Z Enter key: 3 Sample output: Encrypted character is: d Enter key: 3 Sample output: Encrypted character is: C Enter key: 3 Sample output: Invalid input
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
![Question 2
Encryption is a process to secure your data. Caesar Cipher is one of the method to encrypt the
data. In this method we need a key to encrypt data. Now using that key one character is replaced
with another one. [small or capital alphabets are allowed, otherwise invalid input]
Write a C++ program in which, read a character and an integer key from user. Now encrypt the
character using given key.
Example 3:
Sample input:
Enter a character: @
Enter key: 3
Sample output:
Invalid input
Example 1:
Sample input:
Example 2:
Sample input:
Enter a character: a
Enter a character: Z
Enter key: 3
Enter key: 3
Sample output:
Encrypted character is: C
Sample output:
Encrypted character is: d
Question 3:
Carrefour want to give their customer special Ramadan discount on Ramadan packages.
Available package:
• Silver 2000 Rs
Golden 3500 Rs
• Platinum 5000 RS
Detail of discount is:
• 5% on 100 to 150 packages
• 6.5% on 151 to 200 packages
• 7.5% on greater than 200 packages.
Write a C++ program in which, get input from user for package selection [1 for silver, 2 for gold,
and 3 for platinum, any other input will be not valid, in case of invalid input show the related
message and no further action needed] after that get input for count of that selected package
as an integer [Package count should be at-least 1 and at-max 500, apply this check carefully].
Now calculate total bill according to information as given above.
Example 2:
Example 1:
Sample input:
Enter your package choice: 1
Sample input:
Enter your package choice: 2
Enter total count: 160
Enter total count: 110
Sample output:
Sample output:
Total bill is: 523600
Example 4:
Sample input:
Enter your package choice: 3
Total bill is: 209000
Example 3:
Sample input:
Enter your package choice: 10
Sample output:
Invalid package entered
Enter total count: 210
Sample output:
| Total bill is: 971250
Question 4:
Let's design a game which tell about your lucky number. A number is considered as a lucky if
sum of cube of its each digit is equal to that number. Example (153, 1^3 + 5^3 + 3^3 >1+125
+ 27 > 153]
Write a C++ program in which, read a positive integer from user, input should be only positive
integers. Now verify that either the entered number is a lucky number or not.
Example 1:
Sample input:
Example 2:
Sample input:
Enter a number: 3
Enter a number: 153
Sample output:
Not a lucky number.
Sample output:
Lucky number](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5084d905-b80c-42d0-b2c2-3ee3adcb6544%2F7f2354c3-d8c7-4ca5-aae6-a9753acd1ec1%2Fooh99y_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Question 2
Encryption is a process to secure your data. Caesar Cipher is one of the method to encrypt the
data. In this method we need a key to encrypt data. Now using that key one character is replaced
with another one. [small or capital alphabets are allowed, otherwise invalid input]
Write a C++ program in which, read a character and an integer key from user. Now encrypt the
character using given key.
Example 3:
Sample input:
Enter a character: @
Enter key: 3
Sample output:
Invalid input
Example 1:
Sample input:
Example 2:
Sample input:
Enter a character: a
Enter a character: Z
Enter key: 3
Enter key: 3
Sample output:
Encrypted character is: C
Sample output:
Encrypted character is: d
Question 3:
Carrefour want to give their customer special Ramadan discount on Ramadan packages.
Available package:
• Silver 2000 Rs
Golden 3500 Rs
• Platinum 5000 RS
Detail of discount is:
• 5% on 100 to 150 packages
• 6.5% on 151 to 200 packages
• 7.5% on greater than 200 packages.
Write a C++ program in which, get input from user for package selection [1 for silver, 2 for gold,
and 3 for platinum, any other input will be not valid, in case of invalid input show the related
message and no further action needed] after that get input for count of that selected package
as an integer [Package count should be at-least 1 and at-max 500, apply this check carefully].
Now calculate total bill according to information as given above.
Example 2:
Example 1:
Sample input:
Enter your package choice: 1
Sample input:
Enter your package choice: 2
Enter total count: 160
Enter total count: 110
Sample output:
Sample output:
Total bill is: 523600
Example 4:
Sample input:
Enter your package choice: 3
Total bill is: 209000
Example 3:
Sample input:
Enter your package choice: 10
Sample output:
Invalid package entered
Enter total count: 210
Sample output:
| Total bill is: 971250
Question 4:
Let's design a game which tell about your lucky number. A number is considered as a lucky if
sum of cube of its each digit is equal to that number. Example (153, 1^3 + 5^3 + 3^3 >1+125
+ 27 > 153]
Write a C++ program in which, read a positive integer from user, input should be only positive
integers. Now verify that either the entered number is a lucky number or not.
Example 1:
Sample input:
Example 2:
Sample input:
Enter a number: 3
Enter a number: 153
Sample output:
Not a lucky number.
Sample output:
Lucky number
![Question 1:
LESCO want to make an automated system for their electricity bill calculation. They charge
consumers in two different rates like peak hours and normal hours.
Rate of each unit in peak hour is 22.65 PKR, and in normal hour is 16.65. Government applies tax
in bill is 15%. (Total Bill for both type of units, then apply tax)
Write a C++ program in which read, number of units in peak hours and number of unit in normal
hours as input from user. Now calculate total bill according to the information which is given
above.
Еxample:
Sample input:
Enter unit in peak hours: 100
Enter unit in normal hours: 1000
Sample output:
Bill for peak hours: 2265
Bill for normal hours: 16650
Total amount before tax: 18915
Tax for the bill: 2837.25
Total bill is: 21752.25
Question 2:
Encryption is a process to secure your data. Caesar Cipher is one of the method to encrypt the
data. In this method we need a key to encrypt data. Now using that key one character is replaced
with another one. [small or capital alphabets are allowed, otherwise invalid input]
Write a C++ program in which, read a character and an integer key from user. Now encrypt the
character using given key.
Example 1:
Sample input:
Enter a character: a
Еxample 2:
Sample input:
Еxample 3:
Sample input:
Enter a character: @
Enter key: 3
Sample output:
Invalid input
Enter a character: Z
Enter key: 3
Sample output:
Encrypted character is: d
Enter key: 3
Sample output:
Encrypted character is: C
Question 3:
Carrefour want to give their customer special Ramadan discount on Ramadan packages.
Available package:
• Silver 2000 Rs
• Golden 3500 Rs
Platinum 5000 RS
Detail of discount is:
5 % on 100 to 150 packages](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5084d905-b80c-42d0-b2c2-3ee3adcb6544%2F7f2354c3-d8c7-4ca5-aae6-a9753acd1ec1%2Fm0n90f_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Question 1:
LESCO want to make an automated system for their electricity bill calculation. They charge
consumers in two different rates like peak hours and normal hours.
Rate of each unit in peak hour is 22.65 PKR, and in normal hour is 16.65. Government applies tax
in bill is 15%. (Total Bill for both type of units, then apply tax)
Write a C++ program in which read, number of units in peak hours and number of unit in normal
hours as input from user. Now calculate total bill according to the information which is given
above.
Еxample:
Sample input:
Enter unit in peak hours: 100
Enter unit in normal hours: 1000
Sample output:
Bill for peak hours: 2265
Bill for normal hours: 16650
Total amount before tax: 18915
Tax for the bill: 2837.25
Total bill is: 21752.25
Question 2:
Encryption is a process to secure your data. Caesar Cipher is one of the method to encrypt the
data. In this method we need a key to encrypt data. Now using that key one character is replaced
with another one. [small or capital alphabets are allowed, otherwise invalid input]
Write a C++ program in which, read a character and an integer key from user. Now encrypt the
character using given key.
Example 1:
Sample input:
Enter a character: a
Еxample 2:
Sample input:
Еxample 3:
Sample input:
Enter a character: @
Enter key: 3
Sample output:
Invalid input
Enter a character: Z
Enter key: 3
Sample output:
Encrypted character is: d
Enter key: 3
Sample output:
Encrypted character is: C
Question 3:
Carrefour want to give their customer special Ramadan discount on Ramadan packages.
Available package:
• Silver 2000 Rs
• Golden 3500 Rs
Platinum 5000 RS
Detail of discount is:
5 % on 100 to 150 packages
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY