I need a program that asks the user to input a value of type long and then prints out the corresponding ASCII/ Unicode character?
2017-02-13 19:06:28 UTC
I m having trouble with a homework question and need some help with it.
Five answers:
Kaydell
2017-02-14 11:36:12 UTC
If you need Java code, I can help you because I'm a Java tutor. I enjoy teaching so I don't charge much.
We can work together for the first hour for free. No pressure to continue.
My name: Kaydell
Email address: kaydell@yahoo.com
Skype: live:kaydell
Will you give it a try?
roger
2017-02-14 01:03:16 UTC
here it is in C
long c;
printf("enter an integer:');
scanf("%ld ",&c);
printf("the glyph for %ld is %c\n",c,c);
husoski
2017-02-13 19:27:15 UTC
In Java and C#, as in most implementations of C/C++, the code point fits in an int.
// input the value
System.out.print("Enter a character code: ");
int codePoint = myScanner.nextInt();
// convert to 1 or 2 character UTF-16:
char[] chars = Character.toChars(codePoint);
// print result:
System.out.println("Unicode character " + codePoint + " is " + new String(chars));
2017-02-13 19:11:48 UTC
I bet you're having trouble if you don't even know which programming language you're using. I'll assume you're using FreeBasic:
screen 0
dim n as long
do
input "Enter a number",n
print asc(n)
loop
no1home2day
2017-02-13 19:07:57 UTC
Unlike others, I'm willing to write that code for you, but as a freelance programmer, I charge $75 an hour, or any fraction thereof, with a minimum of two hours. In addition, if this is a rush job, I add 15% to the final fee. Do we have an agreement? Or did you want to do your own homework?
Otherwise, you can get started, and as you have specific questions, you can ask. If you can’t even get started, it’s time to drop that class and take up something simple, like basket weaving.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.