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...
icon
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
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
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
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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…
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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY