[Solved] Can you give me some suggestions on my problem?

I applaud your decision to follow your approach through. Allow me to start a step-by-step answer according to the compromise described here (applicable to homework, challenges and very disciplined self-learners like you):How do I ask and answer homework questions? Step 1: You program is able to look at digit by digit of the number in … Read more

[Solved] How to find the maximum’s index?

You have declared: public double MaxKiv() { So yes, obviously this gives you a double. To get an int instead, simply change the declaration to return an int: public int MaxKiv() { The value you are returning, index, is already declared an int, so this should be enough fix your issue. 0 solved How to … Read more

[Solved] Can you help me to simplify codes OR in PHP

In answer to your question, no, you can’t use OR statements this way. What you can do is make $quantity conditionally based on the data you’ve got, for example: $price = !empty($item->unit_price) ? $item->unit_price : $item_kit->unit_price; $quantity = $fetch_barcode[‘item_price’] / $price solved Can you help me to simplify codes OR in PHP

[Solved] sorting by first digit

.sort() should reorder the items like that by default. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. console.log( [1, 2, 3, 4, 10, 11, 12, 20, 29, 30, 39, 40, 49, 101, 110, 119, 123].sort() ); 1 solved sorting by first … Read more

[Solved] Implementation of hash_multimap in C++

The problems seem pretty straightforward. warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. … Read more

[Solved] Pure CSS static starfield [closed]

As an exercise in “let’s see what happens if…” the following code was directly stolen from here and modified slightly to be static. The result is predictable: a basic, repetitive star field. <html> <head> <title>Testing a starfield</title> <style> #space, .stars { overflow: hidden; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .stars … Read more

[Solved] F# : not sure how to start [closed]

3. type Line = {a:double; b:double} let LinesIntersection x y = if x.a <> y.a then Some ((x.b – y.b)/(y.a – x.a), (y.a*x.b – x.a*y.b)/(y.a – x.a)) else None let l1 = {a = 2.0; b = -3.0} let l2 = {a = -3.0; b = 2.0} let l3 = {a = 2.0; b = … Read more

[Solved] sql aggregate and split [closed]

This uses STRING_AGG to aggregate the strings into one long one, and then a Tally Table to split into the new rows. It is assumed you have a column to order by. if you do not, you cannot achieve what you are after without one as data in a table is stored in an unordered … Read more