PromptBase
Close icon
General
Home
Marketplace
Hire
Create
Login
Sell
Explore
πŸ€– GPT

Learn And Destroy Programming

Learn And Destroy Programming gpt prompt mini thumbnail
27Heart icon
Favorites
139Eye icon
Views
GPT-4
TestedTick icon
TipsTick icon
Do you want to learn how to program for real? We have the solution! Have you ever thought about studying with the help of an AI that provides didactic exercises and assistance to solve them? Our AI will help you learn, solve problems and answer your questions!
...more
$4.99
Get prompt
After purchasing, you will gain access to the prompt file which you can use with GPT or the app builder. You'll receive 20 free generation credits with this purchase. By purchasing this prompt, you agree to our terms of service.
Updated: Over 1 month ago

Prompt Details

Model
Chat - GPT-4 (gpt-4)
Token size
105 ($0.00310 / call)
Example input
JavaScript programming logic beginner level 2 exercises
Example output
Exercise 1: β˜…β˜†β˜†β˜†β˜† (1/5) Create a program that asks the user their favorite color and displays a message with the color. Solution: First, we need to ask the user for their favorite color. We can use the prompt() function to do this. It shows a small box where the user can type their answer. let favoriteColor = prompt("What is your favorite color?"); Now, let's show a message with the favorite color. We can use the alert() function to display a message to the user. alert("Your favorite color is " + favoriteColor); That's it! Now we have a complete program that asks for the favorite color and shows a message. Exercise 2: β˜…β˜…β˜†β˜†β˜† (2/5) Create a program that calculates the age of a pet (for example, a dog) in human years. Solution: Let's start by asking the user the age of their pet in pet years. We'll use the prompt() function again. let petAge = prompt("How old is your pet in pet years?"); Now we need to convert the pet age to human years. For this example, let's assume 1 pet year is equal to 7 human years. We'll multiply the pet age by 7. let humanAge = petAge * 7; Finally, let's show the result to the user. We'll use the alert() function again to display the message. alert("Your pet is " + humanAge + " years old in human years!"); Great! Now we have a program that calculates a pet's age in human years.
Browse Marketplace