-pseudocode help-




A company provides home insurance for residential customers. The basic cost of home insurance is a fixed price of £50 per month. However the premium is discounted based on the following four factors. Burglar alarm installed: 2.5% reduction Window locks installed: 1% reduction Window bars installed: 2% reduction Note that the final price is subject to 20% VAT. Note that insurance can be paid in a one-off payment, or by monthly direct debit. If the customer chooses to pay by one-off payment, then there is a 2% discount on the premium. Create a program that prompts the user to whether they have a burglar alarm, window locks, etc., then prompts the user to state their preferred payment method. The program should then calculate and display the customer’s monthly home insurance premium on the screen. What you will need to complete this task. IF/ELSE statements Make sure you identify and declare all required variables and constants. Also, initialize any variables and/or constants that need initializing. Output: “Your calculated home insurance premium is £ [insurance premium]

Firstly, welcome to the forums.

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://www.freecodecamp.org/learn.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile:

I want to get a template in this type of format.

i still haven’t receive any message from you

You probably won’t get a response unless your code / question has something to do with FCC or, at the very least, a programming language. It looks like your question is from an assignment of sorts? It’s a lot more helpful to the community (and therefore helpful to you as well) if you construct your question to be as specific as possible, and include all of the relevant code. Since this question doesn’t seem to have either relevance to FreeCodeCamp or usable code, I’d say this isn’t the best place to get an answer to your problem. I hope this helps!

Yeah, FCC stuff probably gets the most attention, but there is nothing wrong with asking non-FCC questions. If he’s looking for help on pseudo code, that is related enough to coding - I actually think it’s an underappreciated topic.

@Lootpseudo As said, this is a teaching site, we don’t do people’s homework. But we are willing to look at what people have tried and give some advice.

i still haven’t receive any message from you

Remember that most of us are volunteering our free time here.

I want to get a template in this type of format.

There is no “template” for pseudo code. It is just writing out the process, without using code, mostly in plain language with some pseudo-code like elements.

For example, recently someone asked me about something and I gave this as an example for pseudo code for if my wife comes home and tells me to unload the grocery from the car:

loop going to car until groceries empty
  if there are still frozen groceries in car
    grab an armful of frozen groceries 
    walk to kitchen
    put away groceries
    continue next loop
    grab an armful of groceries 
    walk to kitchen
    put away groceries
    continue next loop
lock car
return to apartment
close front door
kiss wife on cheek

It just gets the idea and uses some vague control structures like if/else and loop. You might use other common control structures (switch, loop until, etc.) It’s not a set language, just communicate the idea.

As to your data structure, is it supposed to be language specific or is it a pseudo kind of thing too?

But we’re not going to do your homework for you. Give it a try and let us see what you come up with.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.