473,411 Members | 1,998 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,411 software developers and data experts.

Help with Code [HELP] [JAVA]

Good Morning! Could someone help me with the code for the problem below? It is an exercise suggested by a professor of an engineering course. Below is the requested, if anyone can help, I would be very grateful.

"In previous exercises, we created an algorithm to convert a resistor color code into a numerical resistance value. Now, we'll do the reverse. Make a program that, when entering the resistance value, returns the resistor color code.

Note: Just consider resistance values ​​from 10 Ω. In other words, just consider the colors black, brown, red, orange, yellow, green, blue, violet, gray and white. No need to consider resistors larger than 91 MΩ. In other words, it will eventually not be necessary to use the unsigned int or long int data types to store the resistor values, as the values ​​will not be very large numerically.

Part 1 ----> After the welcome messages and information, including the name of the author of the program, the user must enter the keyboard with an integer value between 10 and 91000000. The program can only advance if the user types one integer in this range of values.

Note: There is no need to test if the user typed an integer.

Complement: when pressing enter, ‘Ω’ must be printed after the entered number.

Part 2 ----> The computer must identify the first two digits and inform if the resistor is part of the E-24 series. (10, 11, 12, 13, 15, 16, 18, 20, 22, 24, 27, 30, 33, 36, 39, 43, 47, 51, 56, 62, 68, 75, 82, 91)

Note: Remember to make simple and short solutions.

Complement: if not part of E-24, ask again for resistor.

Part 3 ----> Must have a method that takes a number, between 0 and 9, and returns a string with the name of the color. This method should be used to get the 3 colors.

Part 4 ----> The 3 colors returned must be stored in a string vector. Print the three colors on the screen.

Complement: The method call developed in (3) must be inside a repeating loop.

Part 5 ----> Ask user for resistor power. Return to the user the maximum voltage that that resistor can be subjected to ( 𝑉=√𝑃.𝑅 ). The calculation must be done within a new method.
Oct 19 '21 #1
1 3654
dev7060
636 Expert 512MB
Good Morning! Could someone help me with the code for the problem below? It is an exercise suggested by a professor of an engineering course. Below is the requested, if anyone can help, I would be very grateful.

"In previous exercises, we created an algorithm to convert a resistor color code into a numerical resistance value. Now, we'll do the reverse. Make a program that, when entering the resistance value, returns the resistor color code.

Note: Just consider resistance values ​​from 10 Ω. In other words, just consider the colors black, brown, red, orange, yellow, green, blue, violet, gray and white. No need to consider resistors larger than 91 MΩ. In other words, it will eventually not be necessary to use the unsigned int or long int data types to store the resistor values, as the values ​​will not be very large numerically.

Part 1 ----> After the welcome messages and information, including the name of the author of the program, the user must enter the keyboard with an integer value between 10 and 91000000. The program can only advance if the user types one integer in this range of values.

Note: There is no need to test if the user typed an integer.

Complement: when pressing enter, ‘Ω’ must be printed after the entered number.

Part 2 ----> The computer must identify the first two digits and inform if the resistor is part of the E-24 series. (10, 11, 12, 13, 15, 16, 18, 20, 22, 24, 27, 30, 33, 36, 39, 43, 47, 51, 56, 62, 68, 75, 82, 91)

Note: Remember to make simple and short solutions.

Complement: if not part of E-24, ask again for resistor.

Part 3 ----> Must have a method that takes a number, between 0 and 9, and returns a string with the name of the color. This method should be used to get the 3 colors.

Part 4 ----> The 3 colors returned must be stored in a string vector. Print the three colors on the screen.

Complement: The method call developed in (3) must be inside a repeating loop.

Part 5 ----> Ask user for resistor power. Return to the user the maximum voltage that that resistor can be subjected to ( 𝑉=√𝑃.𝑅 ). The calculation must be done within a new method.
What have you done so far?
Oct 19 '21 #2

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

Similar topics

6
by: Michael Lauzon | last post by:
A while back, I had a program that I was working on, while taking Java in a Web Design & Development course -- this was back in 1999 -- not having the mindset of a programmer I failed that part of...
9
by: F. GEIGER | last post by:
I've dev'ed a Python prototype of an app, that besides the internals making it up has a gui. While test-driven dev'ing the app's internals in Python is fun as usual, dev'ing the GUI is not so...
3
by: Sai Kit Tong | last post by:
Hi, I am developing a new application running on Windows platform that needs to interface with existing legacy code - written in basic C / C++. I am trying to evaluate Java vs C#...
2
by: cursed_witch | last post by:
hi! am taking java class. we were asked to do a program that manipulates strings. am not good at it and i'm already failing in class. could anyone help me how to do it. this is an example on how the...
4
by: fortepianissimo | last post by:
Is there a solution to enable Java programmers to call functions written in Python? Any wrapper generator that wraps Python code into some Java-callable form? I briefly looked at Jython, but if...
1
by: pixcee2000 | last post by:
hi plz tell code in java program form?
1
by: 848lu | last post by:
hey i really need help...i got this code....basically im suppose to make a calender that allows a user to type in month and year .... and the calander displays it on the scree using...
26
by: Hazza | last post by:
Hello, I am teaching myself java and am completely stuck. I am using the java development kit and vista command prompt to compile and interpret programmes. I am getting error codes which don't make...
1
gautamz07
by: gautamz07 | last post by:
import java.awt.*; import javax.swing.*; import java.swing.JFrame; public class DisplayMouseCoordinates extends JFrame implements MouseMotionListener { JLabel displayCoords; public...
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
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
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,...
0
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...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.