473,698 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

May you help me create a java program that performs integer division.

1 New Member
Create a java program that performs integer division.
The program will ask the user for two integer numbers and will divide the dividend by the divisor.It will then output the results(quotien t) and the remainder of the division.

*Proof Test Case:
Dividing two negative numbers
Dividing two positive numbers
Sep 10 '10 #1
1 1866
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
Hi Marge,

Welcome to bytes. We are more than happy to help you. But we won't provide code for you. We help people who are stuck with some particular problem in their code.

Please read FAQ

We suggest you write your own code and if you have problem with it. Please post back.

Regards
Dheeraj Joshi
Sep 11 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

19
5163
by: Imbaud Pierre | last post by:
integer division and modulo gives different results in c and python, when negative numbers are involved. take gdb as a widely available c interpreter print -2 /3 0 for c, -1 for python. more amazing, modulos of negative number give negative values! (in c). from an algebraic point of view, python seems right, but I thought python conformity to the underlying c compiler was a strong commitment, obviously not here, and I found no...
24
19365
by: Teis Draiby | last post by:
In .NET, can I be sure that the result of a division between two integers always is truncated rather that rounded to nearest? Example: 99 / 50 = 1 regards, Teis
5
3087
by: Tyler | last post by:
Hi ppl, I know it's forbidden to mention Java in this newsgroup but I've been presented with a problem which requires that my C++ program communicate with another java program. What is the best,simplest and quickest way to go about this? I was thinking, I could have my C++ program write data to a file and then my Java program pick it up from there but this is a little too
2
591
by: Darius Fatakia | last post by:
hi, i'm new to MS Visual Studio and C++ but not to C programming in general. i'm trying to divide two integers and get their actual quotient (eg 5/3 = 1.666667 etc). i thought i had type cast correctly, but please let me know, because it appears to be rounding off. my code follows. Thanks! void DrawLine(GLint x1, GLint y1, GLint x2, GLint y2) { int i, pk, dy, dx, yc, xc, inc, temp;
6
35291
by: J.Marsch | last post by:
Suppose that I have an integer division problem, but I want the answer was a float. What's the cleanest syntax for that? Example: In this code, the variable z ends up == 0. And that is correct, because this is integer division and the values are trunc'd. No problem. But what's the most elegant code given that x and y have to be ints, and I want z to be a float or double? Code:
9
43549
by: PengYu.UT | last post by:
Hi, The usually integer division will round the result to the biggest integet smaller than the float version division.For example, 10/3 = 3. I'm wondering if there is any easy way to round it to 4 for this case? Thanks, Peng
1
2821
by: twin2003 | last post by:
need help with inventory part 5 here is what I have to do Modify the Inventory Program by adding a button to the GUI that allows the user to move to the first item, the previous item, the next item, and the last item in the inventory. If the first item is displayed and the user clicks on the Previous button, the last item should display. If the last item is displayed and the user clicks on the Next button, the first item should display. the...
7
2998
by: rohitsripathi | last post by:
i need help writing this program... i am in college and i do not have time do this right now as i need to study for another test....but this is due tonight...i will pay $5 if you accept to do it and i will pay another $10 upon completion> CISY 103 - Project 01 - Fall 2007 - 02x Daily Sales report for Kahuna Burgers Overview The manager of the Kahuna Burgers wants to run a report on a daily basis. The manager is concerned with the total...
9
5008
by: Fsunka | last post by:
Hey, I have a project due around February 28. I have to create a program that asks the user for the number of players that want to play bingo. Then it creates that many bingo cards. Then it calls out BINGO numbers, but it can't make a repeat call out. Also, when something is called out, I have to somehow mark on the card that it has been called out. When the person gets 5 horizontally or vertically (not diagonally) then the programs says...
0
1243
by: yabighelen | last post by:
HELP!!!!! I have to write a program that does this: Create a program that encrypts and decrypts a message... Inputs: A typed message Output: When the encrypt button is clicked the input message is encrypted. When the Decrypt button is clicked, the message is decrypted.
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.