consider the simple problem of placing four coloured balls:red,blue,green and white in 15 boxes.what are the numbers of distinct ways in which balls can be placed in these boxes,if each box can hold only one ball ?also write the generalized formula for this numerical result.
Using while loop and If statements, print all the letters in the following string except for the letter ‘g’ and ‘o'.Sentence is ‘goodbyemybaloon’. Use break and continue in program as well.
list queries for whom reports can be generated
Write a program that takes an input letter from the user until a vowel is entered. Use infinite loops (while True:)
Write a program that rolls a dice until the user chooses to exit the program.
Use random module to generate random numbers.
Non-Adjacent Combinations of Two Words
Given a sentence as input, find all the unique combinations of two words and print the word combinations that are not adjacent in the original sentence in lexicographical order.Input
Sample Input 1
python is a programming language
Sample Output 1
a language
a python
is language
is programming
language python
programming python
Sample Input 2
raju always plays cricket
Sample Output 2
always cricket
cricket raju
plays raju
Secret Message - 1
Given a string, write a program to mirror the characters of the string in alphabetical order to create a secret message.
Input
The input will be a string in the single line containing spaces and letters (both uppercase and lowercase).Output
The output should be a single line containing the secret message. All characters in the output should be in lower case.
Explanation
For example, if the given input is "python", "p" should replaced with "k", similarly "y" with "b", "t" with "g", "h" with "s", "o" with "l", "n" with "m". So the output should be "kbgslm".
Input 1:-
python
Output 1:-
kbgslm
Input 2:-
Foundations
Output 2:-
ulfmwzgrlmh
Input:-3
python learning
Output 3:-
kbgslm ovzimrmt
St. Joseph school planned to create a system to store the records of students studying in their school. They need to store various kinds of data about their students. Write a C# program based on the class diagram given below and initialize the variables with proper values and print it
SCHOOL DEMO:
rollNumber : int
studentName : string
age : bytr
gender : char
dateOfBirth : DateTime
address : string
precentage : float
Write a program to define a two dimensional array of numbers to store 5 rows and 6 columns. Write a code to accept the data, assign it in array, and print the data entered by the user.
Define a single dimension array of strings to hold the name of City. Accept some values from the user and store them in the array. Use foreach loop to print all the data of the array.
Create a class named ProductDemo which accepts the details of the product, converts the details into reference types using boxing and displays them by converting them into their relevant types using unboxing and calculate the amountPayable. Refer the class diagram given below.
Input:-
Enter the id of product : 101
Enter the name of the product : Segate HDD
Enter Price : 9000
Enter quantity : 2
Output:-
Product Details :
Product id : 101
Product name : Segate HDD
Price : 9000
Quantity : 2
Amt Payable : 18000.00