The particular problem I'm having is when it comes to rounding the loading bar width after the calculation.
The current code takes the hourly value associated with each button and creates a percentage that dictates the loading bar's length. However there is a rounding error associated with the calculation that causes the loading bar to not always match the length exactly.
Here are the most important snippets of code:
This section of code is responsible for getting the hourly value from the "add to itinerary" button.
The set duration function which sets the loading bar's length.
I tried performing this calculation without any rounding and got loading bar errors. I've tried rounding the result to the nearest integer and the nearest multiple of 5. I still get issues, particularly when the loading bar is being shortened, which is the exact same calculation just inverted.
Some other issues:
1. On the live website, the hover effect and clickability don't register on all of the buttons. I've tried inspect element and can't see any different between the buttons that work and dont.
2. If I press one itinerary button quickly, I'm able to bypass the maximum allowable hours. For example, if the max itinerary is 10 hours, if I click the button very quickly I can have activities totalling over ten hours. I don't understand why the pace of the clicks matters when it should be going through the if else loop every time.
I needed to build this website ASAP so I used what I had known up until this point which was JS DOM manipulation.
I'm diving into React now, and I guess I'll use this thread as an opportunity to clear something up. Most of the tutorials use create-react-app, which seems to be some kind of simplified tool for making one page react apps. If I wanted to go more indepth and use the whole library, what would be the NPM import and how do I integrate that into a web development project.
I have a JS function that needs to extract the heading inside of a div box. The div box contains the button that fires this action. In a previous version of the code, the div just contained a heading, paragraph, and the button. So all I had to do was set the button's class to active and select the previous sibling.
However, the div is beginning to fill up and I'm having to list a lot of previous sibling calls, and it no longer grabs the correct element. Here is the code below:
I was going to get to the GUI output when the rest of the code worked. And my eventual idea was to navigate from textfield to textfield using arrow keys or WASD so that values could be entered quickly. I figured the output should also have a session history that displays all of the values you computed for easy reference in your calculations.
Trying to build an interpolation calculator that takes inputs from textfields and then displays the answer. I'm having trouble getting my textfield's value to convert properly to double. Here is the minimum reproducible example.
If I enter any arbitrary number, 75, 7.5, .75 and press enter I get 0.0 as my return, and the exception handlers work properly.
Okay, is there anyway to access the accountinfo from the accountsearcher method?
The text document is a list of bank account names. Bank account names are created via the account name generator, which takes the person's username and password and merges it into an account name.
Ex: username: bob password: 1234 accountname = bob1234
If you want to see if an account exists, you type the username and password, the accountname generator turns it into an account name which is our search query. The program then searches the arraylist for the account name (search query)
This section of the program loads the list of account names into an array list. Via methods this arraylist is searched and modified. I want these actions to be performed via a method that can be called
from other parts of the program.
I recently finished a genealogy program project that helped me reinforce my understanding of classes, objects and methods. However when I look at this program, it looks like something I could have done much more easily with a functional programming paradigm approach.
In other words, the classes I had where simply there because I was doing it the Java way, when I could have done the exact same thing in Matlab without classes. My next couple of projects are going to cover arrays, array lists, and some other Java fundamentals. However, after
I complete these, I'm looking for a project that really requires a solid understanding of OOP to execute correctly. I saw someone suggest creating a minesweeper clone, but will that mean I have to go in depth into Java GUI's before I attempt this project? I'm looking for any suggestions
for OOP heavy projects or if you think minesweeper fits the bill.