473,396 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Here are my assignments

3
please can you tell me how do you convert it to the codes.

Write a Java program called MaxMin that prompts the user to enter three integers. The program finds the minimum and maximum values that were entered, and prints the result. Here is an example of the output produced by such a program:

Enter three integers: 17 2 2439
The minimum value is 2
The maximum value is 2439

When you are using the Scanner class and its nextInt method, the method looks for either a space or a newline character to indicate the end of an integer input. Thus you can enter all three integers on one line, and call the nextInt method three times to get the input values. Alternatively, the user can press "Enter" after each integer.

Write a Java program that displays the growth in value of an investment over a number of years. The investment pays a fixed interest rate. Interest is calculated once a year. The interest is compounded -- i.e. in the second year, the interest is calculated not only on the initial amount, but also on the interest that was paid in the first year. The program should prompt the user to enter the initial value of the investment (called the principal), the annual interest rate in percent, and the number of years (callled the term). It then displays a table with two columns, with a heading for each column, and showing the value of the investment after each year.
For example:

Enter the principal, in dollars and cents: 1000.00
Enter the annual interest rate, in percent: 4.5
Enter the term, in years: 5



Years Value of Investment
----- -------------------
0 1000.00
1 1045.00
2 1092.03
3 1141.17
4 1192.52
5 1246.18

You do not need to use any complicated mathematical formulas; you can solve this problem using simple addition and multiplication. Call your class InvestmentValue.

Pay attention to coding conventions such as alignment of braces, upper- and lower-case letters in names, indentation, and white space around operators.
Feb 20 '08 #1
2 1194
Ganon11
3,652 Expert 2GB
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

Then when you are ready post a new question in this thread.

MODERATOR
Feb 20 '08 #2
BigDaddyLH
1,216 Expert 1GB
Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

MODERATOR
Feb 20 '08 #3

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

Similar topics

4
by: Geoff Berrow | last post by:
I've been asked to run an introductory course in PHP for absolute beginners (quit laughing you lot...). I intend to cover programming basics, variables, control structures, loops, simple functions...
15
by: Josef Meile | last post by:
Hi, Textually from the highlights of python 2.4: "Assigning to None - the compiler now treats assigning to None as a SyntaxError." I think in general assignments to built-in types,...
4
by: Jacek Generowicz | last post by:
I am dealing with an application which reads in configurations by calling (a wrapper around) execfile. Any configuration file may itself execfile other configuration files in the same manner. I...
3
by: bearophileHUGS | last post by:
The current version of ShedSkin (http://shedskin.sourceforge.net/ experimental Python to C++ compiler) is rather alpha, and the development work is focused on debugging and implementing some more...
0
by: Nagib Abi Fadel | last post by:
Hi, i'm getting the following error when updating a view : ERROR: Multiple assignments to same attribute "send_sco" When doing the same query directly on the table i'm not getting any error....
1
by: Neil Zanella | last post by:
Hello, In C++ AFAIK structure assignment copies every data member element by element. This rule also works with the gcc 3.2.2 C compiler and even works when one of the members is a union as in...
0
by: Simon Burton | last post by:
I've been doing a little c programming again (ouch!) and it's just hit me why python does not allow assignment inside expressions (as in c): because it is absolutely essential that all assignments...
17
by: Brian Blais | last post by:
Hello, I have a couple of classes where I teach introductory programming using Python. What I would love to have is for the students to go through a lot of very small programs, to learn the...
2
by: joeschnell | last post by:
I'd be embarrassed to tell anyone how long it took me to get this far, since about 8pm last night! I have been assigned some homework to code a program that produces output in a diamond shape on...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.