Preview

J2Me Coding

Good Essays
Open Document
Open Document
4143 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
J2Me Coding
1 import javax.microedition.midlet.*; import javax.microedition.lcdui.*;

public class Calculator extends MIDlet implements CommandListener
{
private Display dsp; private Form fm; private TextField tf1,tf2; private StringItem sitres; private ChoiceGroup cg; private Command cmdq,cmdcalc,cmddate; public Calculator() { fm=new Form("Calculations"); tf1= new TextField("Number1:","",3,TextField.NUMERIC); tf2= new TextField("Number2:","",3,TextField.NUMERIC); sitres=new StringItem("Result",""); cg=new ChoiceGroup("Operation",ChoiceGroup.EXCLUSIVE); cg.append("Add",null); cg.append("Subtract",null); cg.append("Mul",null); cg.append("Div",null); cmdq=new Command("Quit",Command.EXIT,0); cmdcalc=new Command("Calculate",Command.SCREEN,0); fm.append(tf1); fm.append(tf2); fm.append(sitres); fm.append(cg); fm.addCommand(cmdcalc); fm.addCommand(cmdq); fm.setCommandListener(this); } private void calc() { int n1=0,n2=0,res=0; try { n1=Integer.parseInt(tf1.getString()); n2=Integer.parseInt(tf2.getString()); if(cg.getSelectedIndex()==0) res=n1+n2; if(cg.getSelectedIndex()==1) res=n1-n2; if(cg.getSelectedIndex()==2) res=n1*n2; if(cg.getSelectedIndex()==3) res=n1/n2; sitres.setText(res+""); } catch(NumberFormatException e) { sitres.setText("unknown"); } } public void commandAction(Command c, Displayable d) { if(c==cmdcalc) { calc(); return; } notifyDestroyed(); }

public void startApp() { dsp=Display.getDisplay(this); dsp.setCurrent(fm); } public void pauseApp(){} public void destroyApp(boolean unconditional){} }

2 import javax.microedition.lcdui.*; import javax.microedition.midlet.*;

public class rdConverter extends MIDlet implements CommandListener
{
private Display display; TextField rupees; TextField dollar; Form form; Command OK; public

You May Also Find These Documents Helpful

  • Powerful Essays

    JHT2 Task 1

    • 1464 Words
    • 5 Pages

    The effectiveness of my strategy, I believe worked out exactly how it was planned to focus on corporate social responsibility and offer high quality shoes in several markets. I was able to offer a higher prices for shoes due to customers wanting better quality. My market share fluctuated by was higher during a…

    • 1464 Words
    • 5 Pages
    Powerful Essays
  • Powerful Essays

    Jft2 Task2 Part 2

    • 6878 Words
    • 21 Pages

    I have been asked to develop an action plan for Anne Ewers as she moves forward with the ongoing merger of the Utah Opera and the Utah Symphony. A balanced scorecard has been provided for both organizations, and this document will include analysis of the strengths and weaknesses of each organization and recommendations that Ms. Ewers can take to address the weaknesses. Additionally, I will analyze the four aspects (including strengths and weaknesses) of the scorecards for each company and finally identify one highly probable issue that could arise during the merger process in the areas of finance, human resources, and customer satisfaction. Recommendations will be made for how the merged company executives can mitigate each of these issues.…

    • 6878 Words
    • 21 Pages
    Powerful Essays
  • Satisfactory Essays

    You are exiting the currency converter Get user input Yes No Calculate Foreign currency to dollars Display equal value U.S dollar amount End Begin…

    • 585 Words
    • 3 Pages
    Satisfactory Essays
  • Better Essays

    Jft2 Task 2

    • 1445 Words
    • 4 Pages

    In analyzing the Utah Symphony and Utah Opera merger case study, it was obvious that many factors, finances, personalities, and even the community would be involved. The wide reaching affects of a merger between these two types of organizations was eye opening. At the time of the proposed merger, the Utah Opera had a stronger financial footing and was not in danger of closing. The Utah Symphony however, was sliding down a dangerous financial slope. The organizations were structured differently in their number of employees and financial compensation packages. These differences would prove challenging in a merger and could be the basis Bill Bailey would use to oppose such a merger.…

    • 1445 Words
    • 4 Pages
    Better Essays
  • Powerful Essays

    JHT2 task1

    • 3906 Words
    • 9 Pages

    B/B1- My original strategy was to focus on the niche market, only have 50 different pairs of shoes, higher quality and higher price. But I saw that the market was a lot different at first then that and that I was in 8th place. I decided to change after the first round to be more of a lowest price, match the features and performances of everyone else, but also have the biggest availability of everyone. This worked out for me up until the 17th round, I thought that I had 10 rounds not 8 to make choices on, that is when I made a horrible choice and bought a lot of production with a 1 yr loan and so the final year all that loan was due and my overall score fell down 43 points taking me out of 3rd place back to 8th. I thought I would be able to bounce right back because I wouldn’t be losing sales and then the 19th and 20th rounds never came and I was stuck at 8th place. If we had a longer time my strategy would have worked, just ran out of time in the simulation, since strategies evolve over time as the market changes and shifts because of circumstances and ongoing market changes so did my strategy as to wait as long as possible to boost production, but in the end it hurt me financially.…

    • 3906 Words
    • 9 Pages
    Powerful Essays
  • Good Essays

    JFT2 Task 1

    • 758 Words
    • 3 Pages

    As Chairman of the Board for the opera, Bill could rely on Maslow’s hierarchy of needs to find motivation tools to support the merger. Maslow theorizes that as one need is met the needs further up the pyramid become important. Both the opera and symphony exist and have lives thus meeting the physiological needs. Moving up the pyramid from safety through self-actualization Bill could find ways to describe how the merger helps both organizations fill the needs for themselves which would in turn help the merged organization. Each organization has strengths and weaknesses, such as the opera having a stronger fund-raising history or the symphony having a greater reputation, which could lend themselves to ensuring the success of the merger.…

    • 758 Words
    • 3 Pages
    Good Essays
  • Better Essays

    A1. Bill Bailey You will want to read through the theories of motivation found in chapter 8 of your textbook and select the theory that you believe would be most appropriate for Bill Bailey to use, taking into consideration his position on the merger. Now you have the opportunity to show that you can take a theory and show, via discussion, how one would implement each of the components of a theory to successfully utilize the theory in real life. To do this you will need to discuss specifically what Bill might do to implement each of the parts of the theory.…

    • 854 Words
    • 4 Pages
    Better Essays
  • Powerful Essays

    JHT2 Task3

    • 8466 Words
    • 22 Pages

    Hometown Bed and Breakfast is in the heart of downtown Pine Bluff, Arkansas. Arkansas is the natural state, this is because there are so many pretty views that are just nature and it’s beautiful. Pine Bluff is not known as a good place to live or even visit but for some we have no choice but to use the few resources the city has to offer. Relaxation is one thing everyone wants from time to time no matter your age, race, religion, or sexual orientation. Larger cities have bigger and better bed and breakfast venues but most want to go somewhere local to keep from driving over an hour away just to relax or a few days. This paper will focus on the functional market of Bed and Breakfast venues.…

    • 8466 Words
    • 22 Pages
    Powerful Essays
  • Better Essays

    JNT2 Task 1

    • 1417 Words
    • 6 Pages

    The City of Houston currently finds itself in quite a quandary. With a looming budget deficit of nearly $142 million dollars, city leaders have asked employees to begin to re-engineer work processes, cut costs wherever possible and eliminate unnecessary spending. While departments have all been mandated to cut 1% of their total budget for the next fiscal year, there still lies the issue of employees streamlining their work processes in order to eliminate any unnecessary waste.…

    • 1417 Words
    • 6 Pages
    Better Essays
  • Powerful Essays

    Jnt2 Task 1 Needs Analysis

    • 1338 Words
    • 6 Pages

    The fourth survey question asked three 6 -8 grade math teachers what ways students’ can increase their computation skills. The answer choices included: Drills, Repetition, memorization, practice, or flash cards. Each teacher was given the option to choose more than one answer.…

    • 1338 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    Bushido Code Essay

    • 440 Words
    • 2 Pages

    In the medieval times, when the shoguns ruled Japan. There were samurai or japanese warriors. These samurai were people who worked for the damio, or japanese warlords. The daimyo were powerful landowners who would hire samurai to protect their land and belongings. The samurai lived under a strict set of rules, this was called the bushido code. The bushido code was used by samurai warriors and was the ultimate guide on how you should live your life, from fighting skills to self honour and also to be polite, even to the people you didn’t like or even at war with. The Bushido code didn’t stay exactly the same, but always had the same idea and morals. The Bushido code was made and develope between 1192–1333 although lived by nearly all samurai and was known all over Japan it was not an official or written down until…

    • 440 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    JNT2 Task 1

    • 2089 Words
    • 9 Pages

    Much like the runways of Paris with its changing fashion trends, the world of education follows trends as well. Educators cringe when they hear “No Child Left Behind” some ten years beyond its advent. Now, the phrases “Common Core” and “Student Learning Objectives” have teachers seeing red.…

    • 2089 Words
    • 9 Pages
    Better Essays
  • Powerful Essays

    JNT Task 1

    • 1381 Words
    • 6 Pages

    I have recently noticed an instructional problem in the elementary school that I work at. Several of the teachers seem to have problems aligning their instruction with the curriculum they teach. I have witnessed numerous times, teachers incorporating activities into lessons that don’t even relate to the curriculum concepts being taught. The activities being incorporated into the lessons do not align with the objectives specified in the lessons. Therefore, the students are not learning what the objective claims that are.…

    • 1381 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    jnt2

    • 301 Words
    • 1 Page

    A. The instructional problem I identified in my setting is students struggling with identifying themes in literature.…

    • 301 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    JGT Task 2

    • 1850 Words
    • 6 Pages

    Alistair Wu has requested that I look at what the lowest shipping schedule and cost can be based on data that he has provided. He wants to know what the lowest possible cost of shipping will can be. Mr. Wu is also considering increasing production at the Shanghai factory from 1,300 to 2,800 units, and wants to ensure that this growth will be an affordable choice. The first chart that was given lists the factory capacity and what each warehouse demand is. The second chart lists the price of shipping from each factory to each warehouse. The chart looks at the demand in the warehouses as well as the cost to ship there from each factory. It then generates a cost effective shipping plan to ship products to the warehouse with least shipping expense and fills those warehouses first. It then allocates additional products to other warehouses that have higher shipping prices. This is evident with Shuzworld H and Shuzworld F, the program ships the most products to the lower priced warehouses 1 and 3. Warehouse 1 need 2,500 units but Shuzworld F only produces 2,200 units. That means Warehouse 1 will take all off the units from Shuzworld F and still have a demand of 300 units. Warehouse needs 1,800 units and Shuzworld H produces 2,300 units. This means Warehouse 3 will receive all of its units from Shuzworld H and Shuzworld H will still have an excess of 500 units.…

    • 1850 Words
    • 6 Pages
    Good Essays

Related Topics