# Design a simple calculator for multiple number systems

Details:
1.     Before designing the graphical user interface, create an abstract class called Number and four derived classes called Binary, Octal, Decimal, and Hexadecimal. Use the following structure for your Number class. The derived classes should include two constructors paralleling the abstract class and implementations of the two abstract methods.
Number
- n: int
+ Number() // Initialize n to zero
+ Number(int i): // Initialize n to i
+ subtract(Number s): void // Subtract Number s from this Number
+ getN(): int // Obtain current value of n
+ setN(int i): void // Set value of n to i
+ toString(): String (abstract) // Return current number as a String in
// appropriate number system
+ setN(String s): void (abstract) // Set value of n based on String
// representation of the number
// throws NumberFormatException if String
// contains inappropriate characters for
// the given number system
2.     Interface operation.
�     Clicking Binary, Octal, Decimal, or Hexadecimal changes the number in the text box and the current total to the selected number system. If there is a NumberFormatException, display an error message below the text box and do not make the change.
�     Clicking Add To Total or Subtract From Total uses the value in the text box to update the current total. If there is a NumberFormatException, display an error message below the text box and do not make the change.
�     Clear Entry clears the text box, Clear Total resets the current total to zero, and Clear All does both.
�     Indicate the current number system in use with a color and display error messages in red. Feel free to improve the layout as desired.
3.     The Integer wrapper class has a toString() method and parseInt() method each with a parameter called radix that allows you to specify the number system. These will help immensely with your abstract methods. Your calculator should work with negative numbers.
4.     Programming hint: Provide an object of type Number to store the value in the text box and another object of type Number to store the current total. These will be able to hold values from any number system and simplify your coding.

Thank you for posting your homework on the Sun Developer Network Java Forum! Your request has been assigned the following ticket number (you should keep this for your reference) 3405691582.
At the present we are experiencing higher than normal volumes of lack of interest in helping you cheat on another homework assignment. Please stand by until somebody inept comes along to do it for you or you fail. We appreciate your patience in this matter.

### Similar Messages

• Installing data quality management for sap for multiple sap system

Hello folks,
I have an Requirement where i need to install data quality management for sap in multiple sap system.
I have installed it successfully for one system .
here my data services is installed in one server with rfc server as windows services in same server.
i have done the required configuration in ecc side.
my question is how do i use same data services jobs which are configured as real time services for both my sap connection?
in simple terms how do i installed dqm for multiple sap system having single data services server.
thanks,
Shubhangi.

Hi Vishal,
http://scn.sap.com/community/data-services/blog/2013/07/18/i-installed-dqm-for-sap-you-can-too
or you can also refer below SNotes given by SAP:
1732816 - How to manually import DQM ATL files correctly after failed install
Note 1732816 - DQM Adapter Dataflow installer fails on Data Services 4.1
https://service.sap.com/sap/support/notes/1732816
Thanks,
Daya

• Simple calculator for viewing in cmd

i am taking my first programming class and have started to feel overwhelmed. this is my assignment:
To write a program that lets a user do simple math operations on two numbers
? To demonstrate using decision logic in a Java program.
? To become aware of error conditions when writing a program
? To continuing practicing working with two files in a Java program, one Java class
and a tester
Programming Requirements
1. Get user input for the users? name and two integer numbers.
2. Get the user input for a choice of math operation: addition, subtraction,
multiplication.
3. Output the user?s name and the result of the math operation on the two numbers
that were input by the user.
Output: The output should look similar to the following:
Java
Enter a number:
7
Enter another number:
3
Choose a math operation: (A) addition, (S) subtraction, (M)
multiplication
M
Hello Java! 7 * 3 = 21
all i have so far is:
* Calculator.java
* Modified on July 14, 2008
* This class has a method that accepts input from a user about their name, 2 integers, and mathematical
* operation. it then calculates answer and outputs information to screen
import java.util.Scanner; // This import is so that I can have access to the Scanner code.
* @author sandra
/** Creates a new instance of Calculator */
public Calculator() {
* @param args the command line arguments
public static void main(String[] args) {
//I am creating an object of type Scanner to help me get input from the user.
Scanner inputScanner = new Scanner(System.in);
// value for variables are listed below
int firstNumber = 0; // initialize input to 0
int secondNumber = 0:
String inputName = "Doe"; //assigns an initial value for the string value inputName
inputName = inputScanner.nextLine(); //Stores user input for later use
System.out.println("Enter a number");
int firstNumber = inputScanner.nextInt();
myScanner.nextLine(); // Reading the return character from the previous integer input to get around bug...
System.out.println("Enter another number");
int secondNumber = inputScanner.nextIt();
myScanner.nextLine(); // Reading the return character from the previous integer input to get around bug...
System.out.println("Choose a math operation:");
System.out.println("(2) Subtraction");
System.out.println("(3) Multiplication");
// Store the user's response as an integer
int operation = myScanner.nextInt();
myScanner.nextLine(); // Reading the return character from the previous integer input to get around bug...
if (operation == 1 )
i know i'm probably on the wrong track. the if/else statements are frying my brain. PLEASE help. thanks

Looks like you are on the right track to me. I give a little hint.
if(....) {
// what should you do if user enters 1?
} else if(....) {
// what should you do if user enters 2?
} else if(....) {
// what should you do if user enters 3?
} else {
// what should you do if user enters 42?
System.out.println(....);Just work out what the dots are.

• Single hierarchy for multiple target systems

Hi,
I have a version named "Account" with a hierarchy named as "Acc2013".
the hierarchy "Acc2013" is same across Oracle EBS, Oracle Fusion GL, and HFM.
how can i assign multiple node types to the same hierarchy so that i just need to maintain one hierarchy (this case account hierarchy) and select the properties pertaining to each target system?
i.e. i select the Oracle GL from the drop down and give the details for the Oracle GL then i select the HFM category from the drop down and provide the HFM related properties.
the reason why i am asking is, if i dont give the node type, all the unnecessary properties are showing up for other type of hierarchies. for e.g. there is another hierarhcy named cost center there its showing the account related properties.
to summarize, how i can utilize a single hierarchy to be used for different target systems? Appreciate your help. do i need to create different version and hierarchy for different types of target systems?

I'm late to respond to this, but I always preach to customers that it is critical for DRM to act as an enterprise view. This isn't a "System A" hierarchy, or a "System B" hierarchy, but rather it's an asset that is shared by both systems, and therefore attributes for both systems are valid. Since node types provide the ability to hide properties, many interesting options present themselves, not all of which lead to a good outcome in the longer term. If a user doesn't ever want to see properties for a particular system, it would be better to just remove their access to that property category in many cases. (They may already have read only access but they object to "being bothered" with seeing those properties.)
I've seen many DRM implementations head down the other path and end up with duplicate maintenance requirements, configuration challenges, or even having to do major reengineering efforts to transition DRM from a Finance department tool into an enterprise use case feeding a data warehouse. A current customer of mine used a scheme where a checkbox on each property category would make the properties disappear if unchecked...this worked great with a handful of node types, but unfortunately the number of node types needed to support all of these property category combinations was bound by factorial math principles. Consequently the maintenance for this solution went from unweildy to unmanageable as more "non-HFM" data was added to DRM.
DRM implementations should be guided by governance principles and maintenance business rules, rather than than how things appear in DRM. It's how they appear when published that is of primary importance. I think the new features related to Data Governance will help greatly in this regard. Users that are overwhelmed by the DRM UI can easily be limited to the attributes that are relevant to their specific workflows, and only the "Power users" will see everything.

• Find exact RFC Destination for Multiple backend Systems In SAP Gateway

Hi Gateway developers,
I have requirement,if gateway hub system has multiple backend systems( for example two backend systems: ECC and SRM ) then  how  hub system can get the suitable backend alias for exact entity collection..
Here i have developed two entities one entity regards: ECC and second one regards SRM system..within this when I run the service it is always taking any of the same alias for both the collections..
Thanks
Sreenivas Pachva

Hi Srinivas,
You can add the respective system Alias Name: Like logical system name in your URI also.
Example:
/sap/Service Name;mo=ECCCLNT210/zentity1?Customer1='0001'
/sap/Service Name;mo=SRMCLNT400/zentity2?Customer2='ABCD'
Thanks,
Saurabh Gupta

• Unable to define connector for multiple backend systems in BRM

Hi,
I am on GRCFND_A V.11 and SP04
I have multiple backend systems integrated with GRC box. So far I was using one backend connector as default one for role maintenance but it is not feasible if you have to create roles in variuos backend connected systems. I know one way to do so, i can keep changing the default connectors whenever i need to create roles but that is obviously not at all the onw any one would like to go with.
So, I tried to create unique connector groups for every individul backend connectors. But the issue is, the moment i assign the backend connector to the respective connector groups, the same gets reflected to other connector groups as well. So, whenever i either add or delete some of the connectors to any connector groups it gets modified/changed from all of the connector groups.
These are the backend connectors where i have to create roles from BRM whenever needed.
These are the connector groups:
I followed to the ink: GRC AC 10 BRM: Default Connectors with Multiple Back-end R/3 Systems , which is the same as mine issue, but not able to come to the solution point.
would appreciate for your quick response.
Thanks,
Ameet

Could anyone suggest solution to the above mentioned issue please?

• SAP Webdispatcher for multiple SAP systems

Hello friends,
I need some info on SAP web dispatcher configuration for mutliple SAP Systems (different SIDs).
Is it require to install & configure multiple web dispatchers for mutliple SAP Systems (different SIDs)? If it so, what would be the steps and provied me some links
regards
Anand.M

> ... what would be the steps and provied me some links
This you can do on your own, using the search --> then ask more detailed questions.
> Total Questions:  6 (6 unresolved)
Please read the forum rules if you have not done so yet.
Cheers,
Julius

• Compliance Calibrator for multiple SAP systems

I was wondering if anyone could assist me with my query.  We are currently performing an implementation of Virsa CC for a client and have begun to configure a CC DEV system they have installed with their custom SoD rule set.  The DEV CC system (sitting on a stand alone NetWeaver box) is "connected" to four SAP systems (DEV, QA, HR DEV & HR QA).  When we are building "functions" (i.e. raise purchase orders) in CC it asks us to define a SAP system when we are entering the transaction codes.  We've been configuring the functions with SAP DEV as the system, however when we run the analysis of results we would like to get results from QA as well.  It appears that the risk analysis only works for the system that you have defined the functions in (i.e. we get results for users in DEV but not for users in QA).
My questions are as follows:
- Do you need to define all the systems you wish to run a risk analysis for within the function (i.e. function = Raise purchase orders. DEV ME21 & QA ME21)?
- If so, is there an easy way to convert our functions so that they point to QA as well (we've noticed that we can't edit the SAP system once the function is saved)?
- Is it possible to export the functions and then define the SAP system when importing them back into CC (we've noticed with the SAP delivered rule set that SAP DEV was automatically defaulted)?  This is particularly relevant as we would like to export the rules from the DEV CC system and import them to the PROD CC system without having to manually create the rule set again; and
- Is it possible to export the rules and manually change the SAP system reference and import them back into CC (i.e. do a "replace all" DEV to QA)?
Any help would be greatly appreciated.
Thanks,
Alexi

In order to perform what your are trying to do in CC 5.2, you will need to go to configuration and setup a logical system, such as SAP R/3 and define all the appropriate systems for the logical system.  Then, when modifying the functions, you will need to set the tcode (action) to the logical system defined, such as R/3 or APO, etc.
The cross-system functionality only comes into play if you want to analyze the SOD where a conflict would occur if a user had access to one function in one system (for example - purchase order processing in APO) and a conflicting function in a different system (for example - Vendor Master in R/3).
If you simply want to check who has violates a risk against multiple system - the logical system is the best way.  You can have an logical system by system type - R/3, BW, APO, SRM, etc.
To convert this over, you can export the rules and during the export you have to define the new system when exporting the file.  If that doesn't work, I'd just delete everything out, and use the upload files to reload the rules with the correct data.

• Single ADS for multiple SAP systems ?

Can a single ADS installed in a JAVA stack possibly along a EP 7.0 serve multiple SAP systems in my landscape. We got ECC 6.0, EP 7.0, BI 7.0, SRM 5 etc in our landscape. I was wondering whether I can install ADS on any of these systems with Java stack and leverage the functionality to other SAP system or should I have ADS on all the Systems ?
Help appreciated
Thanks

We are using one ADS for more than 10 systems in our product development. It works fine.

• Need a Data Integration for multiple ERP systems

We are doing some research into a data integration layer to our BW 7.3/BOBJ 4.0 from multiple ERPs.  Of course we are looking at Data Services and Information Steward in the BOBJ suite but just looking for anybody's recommendations on the topic.
What technology platform do you use to do the extract, transform, load processes from multiple backend sources into BW?  Any you would advise us to avoid?

Hello Edward,
The answer depends on multiple factors.
Some pointers:
Volume and growth of db in scope planning (Federation vs replication )
If data federation is where you want to move data services / BO tools will be ideal
If your data is coming from multiple ERP systems you can utilize there delta queue to load data via data services (in case of SAP)
Use native DB connect/UD connect functionalities in BW as with BW 7.3 its delta capable.
Moving to BW 7.4 you will have SDA to solve that problem of integration to Non - SAP data into your EDW landscape
These are pointers but I would say talk to enterprise architects and look into the foresight of wheyare you want to move your EDW platform.
Cheers!
Suyash

• Integrating a custom toolchain in Eclipse for multiple host systems

Hey guys
I have a custom GCC toolchain that compiles binaries for my operating system project. I'm having problems with integrating this toolchain in Eclipse CDT to have proper preprocessing and error checking.
On Windows, the toolchain resides in the Cygwin directory "C:/cygwin/ghost", and on other hosts it resides in "/ghost".
Preprocessor:
I've tried to configure the project to use a "Cross compiler" toolchain and set the "Command to get compiler specs" under "C/C++ General -> Preprocessor Include... -> Providers -> CDT Cross GCC Built-in Compiler Settings" to use my compiler (namely i686-ghost-g++). This results in the include paths in my attachment being determined.
Well, this is obviously correct for the compiler but does not work on Windows, because the compiler does not emit the "C:/cygwin" part of the path. Is there a way to define a prefix for these?
Builder's environment:
I'm using plain old bash scripts to build applications; on unix-like systems they run within the normal environment, but on Windows they must be run within the Cygwin environment (so the necessary tools are properly found).
I tried setting the "C/C++ Build -> Builder Settings -> Build command" to sh build.sh to get my scripts used. This does not work with the Cross compiler toolchain setting, as they run in the Windows environment, not in the Cygwin environment. I can fix this by switching to the Cygwin toolchain configuration and setting the "C/C++ Build -> Environment -> PATH" variable properly, but this does not make sense as I also want to use the same project settings on non-Windows systems, too.
Questions:
How is it meant to be done? My goal is to have Eclipse automatically determine the include paths & therefore correctly preprocess sources; also being able to run my build scripts within the correct environment per system.
If configuration is not suitable for this: Where can I find information on how to create a custom toolchain? With that it might be possible to implement it so that it automatically determines what environment to use on each system and how to determine include paths.
Any help is greatly appreciated!
Greets

In order to perform what your are trying to do in CC 5.2, you will need to go to configuration and setup a logical system, such as SAP R/3 and define all the appropriate systems for the logical system.  Then, when modifying the functions, you will need to set the tcode (action) to the logical system defined, such as R/3 or APO, etc.
The cross-system functionality only comes into play if you want to analyze the SOD where a conflict would occur if a user had access to one function in one system (for example - purchase order processing in APO) and a conflicting function in a different system (for example - Vendor Master in R/3).
If you simply want to check who has violates a risk against multiple system - the logical system is the best way.  You can have an logical system by system type - R/3, BW, APO, SRM, etc.
To convert this over, you can export the rules and during the export you have to define the new system when exporting the file.  If that doesn't work, I'd just delete everything out, and use the upload files to reload the rules with the correct data.

• 3rd party tech systems for multiple business systems...

I think this might a very stupid question but still would like to post it..:).. In a 3parties involved scenario, can 1 technical system be assigned to multiple business systems , if all business systems refer to the same 3 party..or does each 3rp party business system needs its own technical system..
Also I need to move only 1 product and the SWCV assigned to the product to QA..I do not want to export entire SLD..By exporting this single product and importing into the SLD of QA, I hope it will not overwrite the SLD components of the QA box but add this new product as delta.
-Teresa

Hi Teresa,
>>>Also I need to move only 1 product and the SWCV assigned to the product to QA..I do not want to export entire SLD..By exporting this single product and importing into the SLD of QA, I hope it will not overwrite the SLD components of the QA box but add this new product as delta
I believe you can only do an incremental export/import
sld does not allow importing/exporting one product...
Remember to do a backup of your QA SLD
then if you make a mistake nothing will happen
<i>"Business systems, which name the logical receiver independently of technical properties. For example, a business system might be a client of an SAP system.
Technical systems with which the hardware of the system is specified in more detail (server data, and so on)."</i>
this should be possible not only for SAP systems
Regards,
michal
Message was edited by: Michal Krawczyk

• EWT calculation for multiple skill groups at Courtesy Callback

Hi All,
I have configured CVP courtesy callback. Call is coming to callback number and call connected with agent .
I have configured EWT for only one skill group. Now I need to calculate proper EWT for multiple skillgroups.
To calculate EWT for ACTV skill group I used the below formula.
ValidValue(((SkillGroup.ACTV.RouterCallsQNow+1)*(ValidValue(SkillGroup.ACTV.AvgHandledCallsT
SkillGroup.ACTV.TalkingOut + SkillGroup.ACTV.TalkingOther))),100)
Now I need to calculate EWT for multiple skillgroups.
Kindly guide me to configure EWT for multiple skillgroups.
Regards,
Fakhrul

Did you get this sorted out? Can you post an example. Thanks a bunch.

• Single Web Dispatcher for Multiple SAP Systems

Having read a number of posts & S-Notes, I found that Web Dispatcher 7.2 is capable of routing between multiple SAP instances.
But despite having troubleshooted, I am unable to make it work. I have two separate installations ERP & Portal on the same host, but my web dispatcher only routes to one of them at the same time. Simultaneous access to these 2 systems is not possible either with URL or Port control procedure mentioned at url http://help.sap.com/saphelp_nw72/helpdata/en/c5/ec466f5544409982c7d3ca29ce1ad3/frameset.htm
Can anyone point an error in my below mentioned configuration of web dispatcher file.
I want requests on port 8853 of my web-dispatcher to be routed to system DEV &
the requests on port 8843 of my web-dispatcher to be routed to system DEP
rdisp/mshost = sapdeverp
ms/http_port = 8100
icm/server_port_0 = PROT=HTTP,PORT=8853
icm/server_port_1 = PROT=HTTP,PORT=8843
wdisp/system_0 = SID=DEV, MSHOST=sapdeverp, MSPORT=8100, SRCSRV=*:8853
wdisp/system_1 = SID=DEP, MSHOST=sapdeverp, MSPORT=8102, SRCSRV=*:8843
Can we mention multiple message servers instead of single message server "rdisp/mshost = sapdeverp
ms/http_port = 8100" ?
Any suggestions ?

Very right in mentioning this point coz myself have been confused over it but if I remove these lines & execute the -checkconfig:
then it states as below:
Checking SAP Web Dispatcher Configuration
=========================================
maximum number of sockets supported on this host: 8192
Checking connection to message server...
ERROR: Connection to message server failed: NIESERV_UNKNOWN
Check ended with 1 errors, 0 warnings
More over accessing the servers give the following error:"
500 Dispatching Error
Error: -26
Version: 7000
Component: HTTP_ROUTE
Date/Time: Mon Nov 29 17:28:11 2010
Module: http_route.c
Line: 3139
Server: solomon__03
Error Tag:
Detail: no valid destination server available for '!ALL' rc=13
I have tried this actually, even tried the option ms/server_port_0 & 1 to replace ms/http_port but it didnt work either.
Any more ideas.. ?

• Design a single template for multiple reports with different column order

Hi,
I need to migrate the existing reports from SQL Server Reporting Services to Crystal Report 2008, and the column order in the report is very important to the clients since clients have existing code to ingest these reports into their database. Now I want to create a single template with lot of parameters for all reports. My question is how I might use one template to create multiple reports with different column orders in the reports?
For example, client A has the following column order in their report: firstName, LastName, DateBirth, SSN. Client B has the following column order in their report: SSN, DateBirth, LastName, FirstName. Can I use one template to create these multiple reports?

-As I mentioned you can find Template Field object in Insert menu of crystal report Designer 2008.
As soon as you select Template Field object you will be able to see a box beside ur mouse cursor. Drag and drop this box at required place. Now when you place this object in report you will get some thing like this "<TemplateField1>" listed under Formula Fields tree. Double click "<TemplateField1>" formula to add your conditions.
-I have not tested it for large amount of Customers. However as the number of customer increases the number of conditions will get increased.
For the customer that want the same ordering of columns you can put those customers under one condition.
for Example...
if(?Client in ['clientA','clientA']) then
<TableName>.<Field>......
-What do you mean be 40 columns? Do you mean 40 fields or you want to show 40 columns in report? Please elaborate.
Regards,
Amrita
Edited by: Amrita Singh on May 21, 2009 7:54 AM