Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

One final comment. Your spec said to calculate the number of salaries over a limit and how many below a limit. Ac cording to the stated spec you should ignore anything that equals the limit. You'll have to adjust either the spec or the code.

rproffitt commented: Great Scott! Code to the spec and wait for the client to tell you that's not what they meant. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You need to put brace brackets around your two statements. Indenting is not enough.

    else if (yearlySalary <= LIMIT) {
        totalSalaryB += yearlySalary;
        lcount++;
    }

But your problems extend beyond that. If the code, according to your spec, is only supposed to calculate the number of salaries below and above a limit then why are you totalling the actual salaries? And why are you bothering to do prompting and input above the loop? And while I am on it, count and lcount are poor variaible names.

Because this is so close to your actual code I don't mind posting this.

int main()
{
    float yearlySalary;
    const int LIMIT = 100000;
    char answer;
    int over = 0;
    int notover = 0;

    do
    {
        cout << "Enter a yearly salary: R";
        cin  >> yearlySalary;

        if (yearlySalary > LIMIT)
            over++;
        else
            notover++;

        cout << "Are there any more values to be input? ('Y' or 'N') ";
        cin  >> answer;
    } while (answer == 'Y' || answer == 'y');

    cout << "There are " << notover << " salaries that do not exceed R100 000." << endl;
    cout << "There are " << over    << " salaries that exceeds R100 000." << endl;

    return 0;
}
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I take it this is homework? I suggest you read the Daniweb Posting Rules, particularly the Keep It Organized section. Alse read Suggestions For Posting Questions.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
  1. Backup the entire hard drive
  2. Wipe the OS partition
  3. Install the OS of your choice
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

just how you can configure an experience?

I'd start by lowering my expectations.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

And as for that $500 billion slush fund that Congress will oversee (as laid down in the bill passed by Congress and the Senate)? Trump basically said f**k you - I'll decide where the money goes and I'm not going to tell you where that is.

rproffitt commented: I've read the checks will have DJT's signature. Isn't it 2 trillion dollars? Also, "appreciate me" orelse. Next vow fealty, hang DJTportraits in home. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

And to think I wasted the last few years of my programming career actually writing code. If only I'd known I could've just posted the specs here and gotten someone else to write the code for free.

AndreRet commented: Hahahaha, Indeed! +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Look at your error message. The else on line 33 doesn't have a matching if. The if on line 25 matches with the else on line 29.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

RE: Allocation of Covid-19 resources...

“He calls all the governors,” Trump said. “I tell him, I mean, I’m a different type of person. I say Mike, don’t call the governor of Washington, you’re wasting your time with him. Don’t call the woman in Michigan.”

“If they don’t treat you right, I don’t call,” Trump said.

Translation - That's a nice state you have there. Be a shame of something were to happen to it.

Trump is now openly running the country's largest protection racket.

rproffitt commented: 5 dollar a barrel oil from Canada? +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Test for tries >= 10 at the top. As well, replace the literal 10 with a const like MAXTRIES and but a break after the "you lose" statement so you break out of the while loop.

Basically

do {
    if (++tries > MAXTRIES) {
        cout << "You Lose!Correct Answer is:" << iNum << endl;
        break;
    }

    if () {
        .
    } else if () {
        .
    } else if 

    etc.
Dilshan_2 commented: Thank You for the help +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I copied your code from the external site and pasted it into the thread. If you post it on an external site then we have to leave Daniweb to look at it and there is no guarantee it is a safe site. Also, if the code eventually disappears from that site then this thread becomes useless for anyone else.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Please be kind enough to describe the problem. If it won't compile then post the error and the line that generates it. If it errors out while running then do the same. If it is running but not doing what you want then describe it like "when I do X the program does Y but it should do Z". Get the picture?

Dilshan_2 commented: please refer below comment +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In Lancaster, California, a 17-year-old has died after being turned away from one facility because he lacked health insurance.

Best health care system in the world. As long as you are rich. Get ready to see a lot more of this. The Canadian health system is likely going to be overwhelmed by this as well but at least nobody will be told "I'm sorry but we can't treat you unless you can pay."

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Pleased to meet you. Welcome to Daniweb. How are you managing during the outbreak?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I haven't had a look at this code in some time. After I discovered the excellent free utility Everything Indexer I no longer needed it. Everything does, well, everything I had coded and so much more. It integrates with Explorer and has almost instantaneous response.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What do you need help with?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

So you want the government to just give you money? Unless you can prove you don't need it that would be a handout (socialism). Unless you were a super-rich corporation, in which case that would be a stimulus instead of a handout. Please understand this is sarcasm. I really want you to get some financial help getting through this. I believe that a Democrat controlled Congress will have a difficult time getting a proper relief bill through the GOP controlled Senate. All the GOP has to do is attach something like a $500 billion slush fund to the bill and then blame the do-nothing Democrats when it fails to pass. And that's all Trump really wants - someone else to lay the blame on.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Show us your code.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Can't fix it if we don't know what's broken.

user287961 commented: My bad,on line 21,22 it says"error C4700 : uninitialized local variable used" +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

A few years ago the GOP was screaming "death panels" during the Obamacare discussions. The idea that the gov'mint would decide which seniors were not fit to live was unacceptable to the party of Reagan. But now the party of Trump is quite willing to sacrifice millions to keep the economy going (at least until after the election). Ancient tribes would sacrifice virgins to assure good weather and healthy crops. Now we are sacrificing seniors for a healthy Wall Street?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It would be improper for any app to force itself to be the active application.

Even though Windows does this all the time.

rproffitt commented: "Hey, hey, look at me!" Also, nice to read that someone else calls Windows an app. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you read the Daniweb Posting Rules and Suggestions For Posting Questions you'd already know that we need to see proof of effort. Show us what you have done so far. If you have a specific problem then please indicate what it is and we will try to help. Your odds of getting quality help are in proportion to the quality of information you provide.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could do that, or you could just do

Button1.Enabled = CheckBox1.Checked

Why write five lines of code when one is shorter and clearer?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think it's much more important to learn how to formulate a plan first. I've taught intro classes and the first thing I did was to get the students to write down in English a step by step process for a problem, in general terms, as if they were describing it to a complete idiot. Before writing a single line of code they had to know how to break down a bigger problem into smaller problems, and how to describe a detailed procedure for each smaller program.

You don't need to know anything about memory management for that, or which order bytes are stored in, or any of the other underlying cruft. I believe that such details can just overwhelm the average beginner.

I found a good, non-programming example of writing out a process was to describe to someone who had never seen shows or shoelaces, exactly how to tie a bow knot.

Diafol might appreciate this analogy - imagine that the only language you spoke was English. If you had to learn a second language, and given a choice between the following two, which would you pick:

  1. Esperanto (constructed with consistent rules)
  2. Welsh (looks like someone swallowed a keyboard and then puked)
rproffitt commented: Excellent. One of the best non-programming courses I took over the years was Systems Analysis. No coding in that class. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I disagree with Dani. I think C++ is a terrible first language for learning the fundamentals of programming and algorithm design. I think Python is much better for that. With C++ you have to be too concerned with the underlying structure of the machine. You shouldn't have to worry about how strings are stored, null termination, pointers as opposed to variables, etc. when learning the fundamentals. Develop good programming habits first. Learn the "how" before the "why". Learn to walk before you learn to fly.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Although you should never code

If True Then Button1.Enabled = True

which is equivalent to

Button1.Enabled = True
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Please post the code in the thread (not as an attachment that I have to open in another application).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

And yet you still won't tell us what the query string is.

le5691 commented: could it be as simple as a space before the word SET: command = "UPDATE[Table1]SET[JOBNO]='" & JOB & "',[LABNO]='" & LAB & +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Registered letter perhaps? Anything that you can use to legally prove you gave them notice should do.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Your problem is in

command = "UPDATE[Table1]SET[JOBNO]='" & TextBox2.Text & "',[LABNO]='" & TextBox3.Text & "',WHERE[ID]='" & TextBox1.Text & "'"

How are we supposed to help you without knowing the values of the textbox controls? Please output the resulting value of command and post it here.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The usual way is with a prompt and inputting a yes or no response. You might want to include a few brace brackets to enclose your main function and while loop.

mahmoud adel commented: I try do it but i can't +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

We won't do your homework for you but if you show us what you have done so far and where you are stuck perhaps we can help.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You might also try Firefox Send

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try taking out the word global. For reference see here and here.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How about showing us your code?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I've seen Sliders but don't recall that episode. We've been careful going out (gloves, distancing, etc). We are always prepared. Not for a crisis, just because we usually keep our freezers stocked up. If it's on sale we buy a lot and freeze. Got vegetables, pork loins, ground pork, chicken, tuekeys and ham in there. And the fixins for home made soup. Not to mention home smoked bacon and cheese. Had to make sure we also had enough dog & cat food to last a while.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The German newspaper Welt am Sonntag has reported that the Trump administration offered the German biopharmaceutical company, CureVac $1 billion to procure the U.S. exclusive rights to a potential COVID-19 vaccine.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

One piece of advice I wish I had learned in my younger years is "Spend less time trying to find the right person, and more time trying to be the right person."

Good luck.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Getting tested in the US could cost up to $1300 if you go to the ER. And if you are put into isolation that may cost you thousands more. With so many Americans lacking adequate health coverage, and medical bankrupty being so high, what are the odds that many people will forego testing, making the spread of Covid-19 even more likely?

rproffitt commented: Are you taking wagers? +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Winnipeg (my city) has its first confirmed case.

rproffitt commented: "Foreign virus" - DJT March 11, 2020 +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Yes.

rproffitt commented: Yes. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

2018 - Trump fires Tom Bossert (Homeland Security adviser) after he called for a biodefense strategy to deal with pandemics. Within weeks, John Bolton disbands a global health team led by Timothy Ziemer. Dr. Luciana Borio (NSC director for medical and biodefense preparedness) resigns that May and is not replaced.

2020 - Trump cuts CDC funding my 10% and HHS (Health and Human Services) by 12% as well as a $30 million emergency fund created by President Obama especially to deal with just such a crisis as Covid-19.

rproffitt commented: Today: "White House ordered coronavirus meetings classified." +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If the question is "how do I change the background color" then the answer is

button1.configure(bg = "red")

or

button1.configure(bg = "green")
rproffitt commented: I see what you did there. "Red Green." Great show. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I came across this recently

A quick check by MarketWatch late Wednesday found a 20-pack of N-95 masks selling on Amazon by a third party for $174, “discounted” from $250. Under normal circumstances, such a pack costs around $15. And a pack of 12 8-oz bottles of Purell hand sanitizer that would typically cost around $20 was listed by a third party for $388.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The White House has banned the use of recording devices (audio/video) at press conferences dealing with Covid-19. Only photographs are allowed. They don't want a repeat of the last one where Trump said the exact opposite of what his experts said.

Federal experts/scientists have been effetively muzzled after being told that all outgoing information must go through the White House. All information going to the public must be deemed ideologically pure.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

As if Jeff Bezos isn't already rich enough. As someone who is at high risk because of a compromised immune system, I thought it might be a good idea to get a few N95 masks. Because local medical supply stores are out of stock I checked Amazon. While the prices are reasonable (pack of 20 for $99), they want $200 for shipping. I bought some luggage a couple of years ago and because my order was over $35 the shipping was free. So how is it that something that weighs less than a box of Kleenex costs $200? Could this be a way of avoiding charges of price gouging? Keep the actual price reasonable but kill on shipping? If this is the case than Mr. Bezos could not only be the richest person alive but possibly also one of the most contemptible.

DeForseti commented: Many talk about the second wave of the pandemic in the fall. Maybe it's not over yet +0
pcbuilderpro commented: Components make the lifeline of the PC's! We have listed all kinds of PC and laptop components so you can build your own PC with minimum efforts and v +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Not seeing a lot of morphine, just a loop, a few ints, some io!

Maybe I'm just having an off day but I'm not getting the morphine reference ¯\_(ツ)_/¯

rproffitt commented: Could be a reference to the hacker in Mr. Robot? +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That will depend on

  1. your platform (Windows/Mac/Linux)
  2. your development environment (gnu, Visual C++, etc.)

I would start by creating a GUI with nothing but stubs behind all the controls. Get the GUI working before adding in production code. That way you minimize complications (and the amount of code you have to wade through while debugging).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Firefox has pushed out an update that (in the US for now) uses encrypted DNS lookup so that your ISP cannot track your DNS queries. Other countries, presumably, will follow shortly.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I've been using the Brave Browser for a couple of months now. It's based on Chrome and has built in ad blocking. It supports Chrome extensions.