Write a Program in C++ In which 1) Read the user file and Generate Corresponding
ID: 3784706 • Letter: W
Question
Write a Program in C++ In which
1) Read the user file and Generate Correspondingly ASCII value of each character in file.
2) Divide every character ASCII value by 10. Calculate Quotient, Reminder and Quotient values stored in Q block, Reminder values stored in R block correspondingly.
3) Calculate 8-bit binary value for each value that is in R block and Q block correspondingly.
4) TAke key 8-bit special symbol fromuser and generate binary of key.
Please i need this program in C++ language. if anybody want to do in Java then its ok! do it. But according to requirements it should work
Explanation / Answer
1)
public class ASCII value {
public static void main(String[] args) {
char character = 'a';
int ascii = (int) character;
}
}
2)public class Divide {
public static void main(String[] args) {
int a = 4;
int b = 5;
float q = ((float)a)/b;
}
}
3)
public class Calculate binary value {
public static void main(String[] args) {
int f = 0, g = 1;
for (int i = 0; i <= 15; i++) {
System.out.println(f);
f = f + g;
g = f - g;
}
}
}
4)
public class generate binary of key {
public static void main(String[] args) {
KeyGenerator gen = KeyGenerator.getInstance("AES");
gen.init(128);
SecretKey secret = gen.generateKey();
byte[] binary = secret.getEncoded();
String text = String.format("%032X", new BigInteger(+1, binary));
System.out.println(text);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.