How to make a number lower case?
Write a program to convert uppercase numbers to lowercase numbers. You may use any part of the Java API but may not team together with other students and turn in group work. You must write the class and provide at least 5 methods but no more than 8 methods to accomplish this task. Your program must be able to accept arguments from the command line
public class MakeLowerCaseNumber
public MakeLowerCaseNumber(String[] args)
int i;
for (i =0; i < args.length; i++)
makeLower(args);
private void makeLower(String argument)
System.out.print("Making " + argument + " into a lowercase number ");
public static void main(String[] args)
MakeLowerCaseNumber makeLowerCaseNumber = new MakeLowerCaseNumber(args);
I am lost. I have written this much. It doesn't make my number lowercase. Can someone show me what to do?
You make a lower case number by adding the difference
return lowerChar +('a' - 'A');
So try doing the same for a number.That's one way. Since this is such a stupid assignment, I have a couple other suggestions:
For every number (which could be interpreted as each individual digit or each string of +/-, digits, and at most one decimal point, or even include scientific notation)...
1) ...just change that number to the string "lowercase numbers."
2) ...change the numbers to their spelled out equivalents (in lowercase, of course), e.g. "three", "forty-two"
3) ...since the assignment said, "convert uppercase numbers to lowercase numbers," you could interpret it as "If the number is uppercase, convert it to lowercase," and then start your processing code with Character.isUperCase(), which will return false every time.
4) ...as a variation on #3, just call to CharacterLowerCase() on each digit.
<editorial>
I hate teachers who think they're being clever and teaching students to "think outside the box" when they come up with nonsensical problems like this. They need a good smiting.
</editorial>
Similar Messages
-
I am trying to enter a hotel password for internet access. The password is all lower case, but the 1st letter I type is always upper case and I can't figure out how to make it lower case. Help?
The digital keyboard on the iPad uses an "Up Arrow" as a symbol to represent its shift key(s). If it's highlighted, then the next letter typed will be upper-case. Just tap on the Arrow symbol and it should be unhighlighted. Now if you type any letter, it will be lower-case.
-
How to search for upper/lower case using string using JAVA!!!?
-I am trying to write a program that will examine each letter in the string and count how many time the upper-case letter 'E' appears, and how many times the lower-case letter 'e' appears.
-I also have to use a JOptionPane.showMessageDialog() to tell the user how many upper and lower case e's were in the string.
-This will be repeated until the user types the word "Stop".
please help if you can
what i have so far:
[code]
public class Project0 {
public static void main(String[] args) {
String[] uppercase = {'E'};
String[] lowercase = {'e'};
String isOrIsNot, inputWord;
while (true) {
// This line asks the user for input by popping out a single window
// with text input
inputWord = JOptionPane.showInputDialog(null, "Please enter a sentence");
if ( inputWord.equals("stop") )
System.exit(0);
// if the inputWord is contained within uppercase or
// lowercase return true
if (wordIsThere(inputWord, lowercase))
isOrIsNot = "Number of lower case e's: ";
if (wordIsThere(inputword, uppercase))
isOrIsNot = "number of upper case e's: ";
// Output to a JOptionPane window whether the word is on the list or not
JOptionPane.showMessageDialog(null, "The word " + inputWord + " " + isOrIsNot + " on the list.");
} //main
public static boolean wordIsThere(String findMe, String[] theList) {
for (int i=0; i<theList.length; ++i) {
if (findMe.equals(theList[i])) return true;
return false;
} // wordIsThere
} // class Lab4Program1
[/code]So what is your question? Do you get any errors? If so, post them. What doesn't work?
And crossposted: how to search for upper/lower case using string using JAVA!!!? -
PA04-How to make existing Number Range/interval external.
Question: PA04-How to make existing Number Range/interval external.
One of the Pernr Number ranges/interval in PA04 is Internal(box is
unchecked) and i want to make it "External" (check the box) to load some data.
Issue: The issue is, the check box is Greyed out and i can not check it. But i have access to
everything else in PA04:
- create and delete number ranges
- change the "Current number"
- Uncheck the box to make the External to Internal.
But i can not Check the box to make it External from Internal due to the greyed
out box for this number range.
The only solution i can think of about it is to - Delete the number range
and add it again and check the box when doing that. And once the Data load is done Uncheck the box.
Is there a better option..?Once you have made your decision to define a number range as 'internal' it is not possible to reverse this. check this http://scn.sap.com/thread/1976017
-
Requirement Tracking Number - Lower Case Letters
Hi Experts,
Generally, Requirement Tracking Number can be saved as Upper case. But i have an issue that in one PR, Requirement Tracking no was saved as lower case.
By PrabhuTry this code which may be helpful.
DATA : lv_string TYPE string VALUE 'ABCdWE1@#F',
lv_string_temp TYPE string.
lv_string_temp = lv_string.
TRANSLATE lv_string_temp TO UPPER CASE.
IF lv_string_temp = lv_string.
WRITE : / 'All caps'.
ELSE.
WRITE : / 'At least one small letters'.
ENDIF.
Regards
Shiba Prasad Dutta -
How to make material number field invisible in MM60?
Dear expert,
Is there any way to make material number field invisible in MM60 for one user?
Best regardsHello,
You may create a transaction variant for MM60 and hide Material code using SHD0. Then create Variant group and assign users to this group.
Thanks,
Venu -
How to make row number in local member dynamic
I have create multiple local member and the formula I the local member is such as
=SUM(row11+row14+row16)
then I add another couple of row before row 11, now the formula should be:
=SUM(row13+row16+row18)
anybody know is there a way how to make the formula in the local member dynamic, which means that if I add rows of drop rows, the formula in local member will automatically change?Hi Jian,
You can create local my by "Activate Local Member Recognition", but make sure "Use Position in axis" should be unchecked.
Also make sure you have added all required Local members before any insertion of rows.
Hope this should work.
Thanks,
Rishi -
I inadvertently used Caps lock. How do I make the type lower case?
This may have been answered before, and if so I apologize.
I tried the search forum function without success, and I tried Pages help without success.
I do not want to retype it.
ThanksThis doesn't come built-in to Pages, but you can add this capability easily -- download the hugely useful WordServices from Devon, which, when installed, will put a "Convert" menu option into the "Services" menu (under the Pages menu).
The system-wide Services menu is one of the extremely powerful yet woefully underused aspects of OS X. -
How to make dynamic selection in case of innerjoin
hi
in run time i will get some table name into g_v_fubw
if i write a select quiry like this its working
SELECT * FROM (g_v_fubw)
INTO TABLE g_it_fubw
FOR ALL ENTRIES IN g_it_werks
WHERE kostl IN s_kostl3 AND
platznr IN s_platz3 AND
werks = g_it_werks-werks AND
matnr IN s_matnr AND
prctr IN s_prctr.
But if i am using inner join like bellow
SELECT
avalev ainvpe vastrd vtxjhr a~bukrs
awerks amatnr
aindei abwtar a~bklas
v~adqty
v~meins
a~peinh
INTO TABLE g_it_temp_display
FROM (g_v_fuba) AS a INNER JOIN
(g_v_abcd) AS v ON
amatnr = vmatnr AND
ainvpe = vinvpe
WHERE a~invpe EQ p_invw AND
a~valev EQ 'P' AND
v~astrd IN g_r_astrd AND
v~txjhr IN g_r_txjhr AND
a~bukrs EQ p_bukrs AND
its not working
how can i write dynamic select quiry using innerjoinHi...
Make sure the structure of g_it_temp_display is same as the selected fields.
FROM (g_v_fuba AS a INNER JOIN
g_v_abcd AS v ON
amatnr = vmatnr AND
ainvpe = vinvpe ).....>
See the syntax...
as below...
SELECT a~knuma_ag "SAP agreement number
a~boart_ag "SAP agreement type
a~zzlegsum "Legacy summary number
b~datab "Begin date
b~datbi "End date
FROM ( /irm/ipbbasp AS a INNER JOIN kona AS b ON
aknuma_ag = bknuma )
INTO TABLE i_irm_kona
FOR ALL ENTRIES IN i_kona_deal
WHERE a~boart_ag IN r_agrmnt_typ AND "SAP agreement type
a~zzlegsum IN r_summ_number AND "Legacy summary number
b~knuma = i_kona_deal-knuma AND "SAP agreement No
b~valdt IN r_ppd. "Prior price date -
How to make a regular expression case insensitive?
Hi,
I am using SAP UI5 .
I am validating the user input using a regular expression to make sure user dose not enter a keyword which is reserved.
var regexAppID = /^(?=^(?:(?!(^Admin$|^AdminData$|^Push$|^smp_cloud$|^resource$|^test-resources$|^resources$|^Scheduler$|^odata$|^applications$|^Connections$|^public|^Public$|[\.]{2,}|^[\.])).)*$)(?=^[a-zA-Z]+[a-zA-Z0-9_\.]*$).*$/;
textField.mBindingInfos.value.type.oConstraints.search = regexAppID;
The regex blocks the user from entering the keywords Admin,AdminData etc.
It works fine if the user enters the value as it is given in regex (ie case sensitive example "Admin").
But when user enters "admin" or "aDmin" etc the regex is not catching it and my server crashes as it bypasses these keywords.Can't you use this expression?
^/(?!ignoreme$)(?!ignoreme2$)[a-z0-9]+$
Then you will have only a match when the word is something else then "ignoreme" or "ignorme2".
Why don't you just check it in an IF statement? if(input==="ignoreme" or ... ) ? It's both static.. or you could put all options in an array and use the statement indexOf to find if it is in the array.
JavaScript Array indexOf() Method
Kind regards,
Wouter -
How does lsmw control upper/lower case?
I have a client that wants all text fields to be in upper case?
How can we control this in lsmw (the only way we are loading data)?
Thanks.In step 'Maintain field mapping and conversion' is where you define how to convert data. Have you tried converting the text to uppercase here?
Thanks, -
How to make online number working?
Hi,
Actually I would have two questions that are independent from each other:
1. I tried to call via cell phone the free online number that I received from ring2me.com. After I was asked for ext code (3 digit number) and after began ringing, nothing happened in my skype. I need to mentoin that I haven't set anything inside skype software for this. What do I need to do so I will get the call?
2. Through whichever application (it does NOT need to be skype so you don't need to mentoin on skype isn't this possible) I also need to get on this same online number SMS. So I need to be able to define the number on my own on which I want to get SMS. Also I should not be required to send any SMS to this particular number in order to receive the SMS. How and where to do this?
EDIT: Oh and what I forgot to say is: I am from Slovenia but can switch IP to usa, thats no problem. However I want and need to use USA online number to receive phone call to skype. Please answer on my both questions above.Hmm getting worried about this now. I have been waiting for a while but still nobody replies. So, again if anyone could answer on both (two) questions so I could use this answers to find the solution then please reply. Thanks in advance.
-
How to make MySQL JDBC Driver case-insensitive
Hi,
I'm porting a jdbc application from oracle to mysql. One of the problem is that oracle's column names are case insensitive, whereas CODE in mySql is different from code (see example posted below).
I know that I can change the source code to use always the same case. But is there a way to make the mysql jdbc driver case-insensitive ?
import java.sql.*;
/* getString(String) is case sensitive for org.gjt.mm.mysql.Driver driver */
mysql> describe currency;
+-----------------+----------------+------+-----+----------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+----------------+------+-----+----------------+-------+
| code | char(3) | | PRI | | |
| name | varchar(40) | | UNI | | |
| shortCode | char(2) | YES | MUL | NULL | |
| exchangeRate | decimal(19,12) | | | 0.000000000000 | |
| changed | decimal(1,0) | | | 0 | |
| markedFlag | decimal(1,0) | | | 0 | |
| updateTimestamp | timestamp(14) | YES | | NULL | |
+-----------------+----------------+------+-----+----------------+-------+
7 rows in set (0.00 sec)
getObject(1)=EUR
Trying code
getObject("code")=EUR
Trying Code
java.sql.SQLException: Column 'Code' not found.
at org.gjt.mm.mysql.ResultSet.findColumn(ResultSet.java:1213)
at org.gjt.mm.mysql.ResultSet.getObject(ResultSet.java:1188)
at mySqlDemo.main(mySqlDemo.java:61)
getObject(1)=USD
Trying code
getObject("code")=USD
Trying Code
java.sql.SQLException: Column 'Code' not found.
at org.gjt.mm.mysql.ResultSet.findColumn(ResultSet.java:1213)
at org.gjt.mm.mysql.ResultSet.getObject(ResultSet.java:1188)
at mySqlDemo.main(mySqlDemo.java:61)
public class mySqlDemo {
public final static void main(String[] args) {
try {
/*== database constants ==*/
String DBHOST = "localhost";
String DBNAME = "test";
String DBUSER = "test";
String DBPASS = "";
String DBDRIVER = "org.gjt.mm.mysql.Driver";
/*== setup database driver and connect ==*/
Class.forName(DBDRIVER).newInstance();
String conurl = "jdbc:mysql://"+DBHOST+"/"+DBNAME;
Connection db = DriverManager.getConnection(conurl,DBUSER,DBPASS);
/*== create sql query and execute ==*/
//String sql = "select code from currency";
String sql = "select Currency.code, Currency.name, Currency.shortCode, Currency.exchangeRate, Currency.changed, Currency.markedFlag, Currency.updateTimestamp from Currency order by code";
Statement stmnt = db.createStatement();
ResultSet rs = stmnt.executeQuery(sql);
/*== display results ==*/
while(rs.next()) {
System.out.println("getObject(1)=" + rs.getObject(1));
// works, because "Currency.code" has been selected
System.out.println("Trying code");
try {
System.out.println("getObject(\"code\")=" + rs.getObject("code"));
} catch(SQLException ex) {
ex.printStackTrace();
// case sensitive !
// does not work, because "Currency.code" has been selected
// "code" != "Code"
System.out.println("Trying Code");
try {
System.out.println("getObject(\"Code\")=" + rs.getObject("Code"));
} catch(SQLException ex) {
ex.printStackTrace();
} catch(Throwable t) {
t.printStackTrace();
}One of the problem is that oracle's column names are
case insensitive, whereas CODE in mySql is different from code (see example posted below).I doubt that.
SQL standards are rather specific that columns names are case insensitive unless quoted identifiers are used. And presumably you are doing that.
What you are seeing is a difference in drivers not databases.
I would guess that the only way to change the behaviour is to modify your code. If you uppercase everything it should work. Or you could use positional rather than named column extraction. -
How to make Repeated number into continuous number ?
Hi All,
I am using a motor with encoder. The encoder give count information. It always count 2000 to 1, and repeat again and again. I want to make it as 1 to 2000, 2001 to 4000 etc.
In summary:
I have count no as 2000, 1999.........1, 2000, 1999......1, 2000, 1999,.....
I want to make it as 1, 2,..............2000, 2001, 2002.....4000, 4001, 4002....
Could you please help me how I can make it.
Thank you for your co-operation!
Regards
AzimHey Azim,
There are a lot of ways you could do this based on the information provided, you could just use an increment in labview instead of the physical encoder if all you are trying to do is count the encoder pulses.
There is also a good tutorial on how to set up a counter
http://zone.ni.com/devzone/cda/tut/p/id/5373
good luck
Beau H
BeauH
Applications Engineer
National Instruments -
How to make phone number lookup in AddressBook work?
I specified many different, country specific formattings for phone numbers (eg: +41-44-123 4567). When enetring the data I simply type +41441234567 and the number gets formatted correctly, according to the country specific formatting. When looking up such a number I have to be careful about the format when typing in the number. As long as I respect the grouping of numbers (for instance by looking up contacts with numbers "44 123 4567") the above mentioned addressbook entry gets wasily found.
As the person has a Chinese name I started to introduce Chinese characters as First and Familyname and just because of that the lookup no longer seems to work. I made many experiments and actually could narrow down the problem to exactly this scenario where non ascii or latin-1 names are used.
Anybody else with similar experiences? Any workarounds known or is it even a known bug? Any help appreciatedWith Addressbook in 10.5 the lookup-problem has disappeared
Maybe you are looking for
-
How do I find original music library?
Okay so we have a few macs in the house and we can't seem to find the original itunes library for my husband on any device? We are upgrading computer and we don't want to lose any of his music, however whenever we go to itunes on all of our other dev
-
Files not showing up in Lightroom 4.4
I was reorganizing/rationalizing my hard drive file folders outside of Lightroom. Now not all the images in the folders show up in Lightroom 4.4 For instance: In a 2014 folder there are 25 files. Lightroom's Folders panel shows the number as 15. If I
-
Add a custom field in rfx.setup
Hello experts, I'm having a hard time adding a custom field (extension) in RFx.setup object (ESO 5.1). In Extension Definitions I don't see "RFx.setup" in the Extended Class Names. The goal is to add a custom field between "Delivery Terms" and "Line
-
Save For Web | Learn Photoshop CC | Adobe TV
The Save for Web dialog box gives you the chance to select the output file type and adjust the size of the images. It allows you to create an optimized version for the Web without altering your original image. Applies to the CC and CS6 versions of Ph
-
Oops, that was Lightroom 5