Assuming a message “Exams!” is to be transmitted over a network. If the message is made up of strings with the given probability: e = 0.4, x = 0.1, a = 0.2, m = 0.1, s = 0.1, and ! = 0.1, derive:
a. The codeword using Arithmetic coding procedures
b. The original message by decoding the codeword in (a).
program to convert 6 digits numbers into words
A program is required for a computer game. The user keys in the number of rounds he wishes to play.
For each round the user enters his lucky number. The program takes the number and divides it with a
secret number. If the remainder of the division is zero, it is considered a draw for the round and the total
score is incriminated by 1. Otherwise if it is any other even number, it is considered a win for the round
and the total score is incremented by 3. However if it is an odd number, it is considered a loss for the
round and the total score is decremented by 3. This is done until he completes his rounds. He wins if the
total score at the end is a positive number. Write a Java program to accomplish this.
Give seconds as input,write a program to print in D days H hours M minutes S seconds
Input 200
Output 3 minutes 20seconds
Input 86400
Output 1 day
Assuming a message “Exams!” is to be transmitted over a network. If the message is made up of strings with the given probability: e = 0.4, x = 0.1, a = 0.2, m = 0.1, s = 0.1, and ! = 0.1, derive:
a. The codeword using Arithmetic coding procedures
b. The original message by decoding the codeword in (a).
Consider a mx n matrix inmatrix of string elements containing alphanumeric values, where m>1, n >=1. Identify and print outarr based on the logic below:
• Traverse the inmatrix in clockwise spiral way starting from the element at (0,0) •
traversal until one of the two conditions is met • The element or the concatenated string is a palindrome with length greater
than 1 There are no more elements left for traversal
. Add the concatenated string to outarr
. If there is any element which has not yet been visited in the traversal, repeat the two steps, forming a new concatenated string that starts with the next element present after the last element previously traversed
Note: Perform case-sensitive comparison
Input format:
First line will contain number of rows m of inmatrix
The next m lines will contain the elements of inmatrix. Each line will have n string
elements separated by (comma)
Create a program that reads trom the console two integer numbers (int) and prints now many numbers between them exists, such that remainder of their division by 5 is O. E
write a JS program to
input
output
input1
[{'name': 'Blake Hodges', 'points':[76, 98, 88, 84]}
output1
['Blake Hodges]
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString.trim().split("\n").map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
const candidatesList = JSON.parse(readLine().replace(/'/g, '"'));
// Write your code here
}
tax criteria
salary tax percentage
>= 50000 5
>= 1000000 10
quick tip
tax = salary * taxPercentage/100
input 1
stuart
developer
840000
output 1
42000
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString.trim().split("\n").map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
const name = readLine();
const role = readLine();
const salary = JSON.parse(readLine());
function Employee(name, role, salary) {
// Write your code here
}
const employee1 = // Write your code here
/* Please do not modify anything below this line */
console.log(employee1.getTaxAmount());
}
Develop a swing application for login validation of a system as shown in the figure. The
application shows two options: one Sign up and another Sign in. When Sign up is selected, a
new screen will appear for asking name, username, password. If the entered username and
password do not exist in the database, it will show a successful message [Name] has
successfully registered and store corresponding username, password in the database,
otherwise the message [Name] already exists in the system will be displayed. On the other
hand, when Sign In option is selected, the user will be prompted to enter username,
password as shown in the figure. Eventually, the application checks whether username and
password both match with some entry in the database. If such entry found in the database,
then a welcome message Welcome [Name] will appear, otherwise an unsuccessful login
message Wrong username/password will be displayed. For message display, the swing dialogs can be used.