his is a program written in C programming language. The wrong this is that this must be an iterration. The program must ask first to input his password. then the next input will be asking the password again. if the input was not the same it must be repeating, saying incorrect, asking for the password again until the input is correct. like this
Q: Write a program that takes a first name as the input, and outputs a welcome message to that name Ex:…
A: Code : import java.util.Scanner; public class LabProgram { public static void main(String[]…
Q: Write an application that will take a 5 digits integer from user and calculate the sumof all digits…
A: Program approach:- // header file. // main function. // Declaring required variables. // Dividing…
Q: Write a c++ program to prompt the user to enter his name. The program should ask the user to guess…
A: The given problem is to be solved in C++ where the user will be asked to guess the password.
Q: Write a program that asks a user to enter a first name, a last name, and a year, and construct an…
A: As the language is not specified answer written in python
Q: Write a program in c ++ that inputs four numbers separated by spaces. The program should count how…
A:
Q: Write a Python program that prompts the user for the cost of two items to be purchased. Then prompt…
A: PROGRAM EXPLANATION: Start. Take the cost of the first item as input. Take the cost of the second…
Q: Write a program that calculates and prints the bill for a cellular telephone company, on the type of…
A: Actually, program is a executable software that runs on a computer.
Q: In python, a) In the Hi-Lo game, the player begins with a score of 1000. The player is prompted for…
A: This is the java code for hi lo game you need to make slight changes in the code i have done more…
Q: How to compute FInal grade =(Prelimgrade*20%)+(Midtermgrade*20%)+(Pre-Finals*20%)+(Finalgrade*40%)…
A: #Code starts print "\n PRELIM GRADE"Quiz1 = input("Enter Quiz 1 :") #taking input of quizQuiz2 =…
Q: Write a C code that asks the user to enter an integer number, then use this number to create a child…
A: #include<stdio.h> int main() { int n; printf("How many childs would you create:");…
Q: I am working on the following java program. I can get the program to run but need it to keep looping…
A: Code in Java import java.util.*; class Main { public static void main (String[] args) { Scanner…
Q: Write a program named Twitter that accepts a user's message and determines whether it is short…
A: using System;public class Twitter { static void Main() { //program starts…
Q: A company wants to secure users' passwords that consists of four digits only by encrytping them.…
A: The programming methodology for the program is given by: Including header files Function prototype…
Q: Write a program for Horizon Phones, a provider of cellular phone service.Prompt a user for maximum…
A: code :-- //for Scanner classimport java.util.*; public class Main{ public static void main(String[]…
Q: Write a C++ program that allows a user to enter their rating of the three movies in the Dark Knight…
A: The answer is in below steps:
Q: Write a program that simulates a login screen. Prompt the user for their username and their…
A: Actually, program is a executable software that runs on a computer.
Q: Problem #3: Write a Java program that prompts the user to enter 5 digit number n and a digit key k…
A: Algorithm: Start Read a number n Read key value k Initialize i to 1 and rev to 0 Iterate through…
Q: Write a python program that keeps track of evidence from 25 forensic cases. The user should be able…
A: I have given a python code in step 2.
Q: In C Language Write a program dist.cthat calculates the distance between two pointsand prints the…
A: given data is In C Language Write a program dist.cthat calculates the distance between two pointsand…
Q: Write a program that will send notification to Warehouse Manger when the inventory of an item become…
A: Step-1: Start Step-2: Declare variable str and quantity Step-3: Take input product name and store in…
Q: Suppose we are talking about a mysterious number called Opaque Number. Any positive integer is…
A: Note: Programming language is missing in the question. So we will answer this program in Python. If…
Q: Write a java program that read unknown number of records from the file attached below named…
A: The java program is given by import java.util.*; import java.io.*; class Main { finalstatic String…
Q: Write a pseudo-code or an algorithm for the problem below. Add comments and clearly explain what you…
A: Problem Explanation: In this problem you are to write a program to explore the above array for a…
Q: Write a program that simulates the proverbial game of Russian Roulette. The program will prompt the…
A: Given: Write a program that simulates the proverbial game of Russian Roulette. Theprogram will…
Q: Write a program that asks the user to enter a password consisting of 7 characters. If the user…
A: Program: //import the header file import java.util.*; //definition of class class Main {…
Q: Write a program in which the user to type his own ID, if the ID is valid it will ask him to enter…
A: Step 1:- Program Approach:- 1.Include header file 2.Declare the variables 3.Use the if-else…
Q: Write a program that plays a guessing game with the user. Have your program read and store an…
A: Input a number and then generate a random number The number should be from 1 to 10 So, applying %10…
Q: create a Python program that simulates a race by calculating the distance Usain Bolt and a series of…
A: First of all, thanks for this fun question, the code is..... # Average speeds in miles per hour#…
Q: Write a Python program that asks a user for their name, age and password. If their age is less than…
A: Solution: Given,
Q: A validation method that takes in the message (as a string) and the offset integer entered by the…
A: Here below I written code for your problem in C#.
Q: Write a program CheckDigit.java that takes a 12 or 13-digit long as a command-line argument and…
A: Program plan: Initialize the variables sum1, sum2. define the variable long number. Iterate over…
Q: Write a program to solve the problem of Tower of Hanoi. User would input the number of plates they…
A: Given: Write a program to solve the problem of Tower of Hanoi. User would input the number of…
Q: write in JAVA LANGUAGE Create a program that will compute PRELIM, MID-TERM, PRE-FINAL, FINALS GRADES…
A: Task : Collect the 3 quiz marks in Prelim Midterm Pre-Finals Finals Output the list of grades…
Q: in python 17. Write a program to prints the integer cube root, if it exists, of an integer. If the…
A: Coded using Python 3.
Q: On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 *…
A: 1) Below is program to output frequencies of the next 4 higher key given an initial key frequency.…
Q: write a java program that determine the alert level for the COVID-19 based on the persentage of new…
A: Program Plan: Import scanner package class covid main method double newCases,tests,casePercentage…
Q: Write a program that simulates the proverbial game of Russian Roulette. The program will prompt the…
A: first, take the input for the bad number and the number of players in the game then loop over these…
Q: Write a program that simulates the proverbial game of Russian Roulette. The program will prompt the…
A: Code: #include <iostream>#include <cstdlib>#include <ctime>#define MAX 50using…
Q: Write a program using the above idea but to solve the following situation: In a certain application…
A: below is the code
Q: Write a Java program called EncryptDecrypt that reads a String from the user called s and then…
A: import java.util.Scanner;public class EncryptDecrypt{ //encryption method public static String…
Q: In Python, A sales event at Trader Jane's is reducing some items by 25%. Store that value to a…
A: Program Planning Prompt the user for giving input on the ticket price of the item. Store the input…
Q: Write a java program call CountVowelsDigits which prompts the user for a string, counts the number…
A: import java.util.Scanner;import java.lang.*;public class Main{ //method to print count and…
Q: Write a program dist.cthat calculates the distance between two pointsand prints the resulton the…
A: #include<stdio.h> #include<stdlib.h> #include<math.h> // function to return…
Q: Write a program that asks users when their birthday is. Use information provided to give them their…
A: Your solution is here with an output.
Q: On a piano, a key has a frequency, say fo. Each higher key (black or white) has a frequency of f0 *…
A: Java code: import java.util.Scanner; public class Main{ public static void main(String[] args)…
Q: Write a simple LMC(little man computer) program that requests the user to input 2 numbers (say, Aand…
A: Program: INP STA M0 INP STA M1 SUB M1 BRP J1 LDA M1 J1 LDA M1…
Q: Implement a program that calculates the bill of a sandwich stand. The program should ask the user to…
A: We need to write a program that calculates the bill of a sandwich stand. The program will ask the…
Q: Write a program that converts a time from 24-hour notation to 12-hour notation. The following is a…
A: Let us consider a Java program that converts a time from 24-hour notation to 12-hour notation and…
This is a program written in C
input password: shaaala
enter your password: shfhfh
incorrect!
enter your password: fjdbifj
incorrect!
enter your password: shaaala
correct!
something like that
here is my code please fix it:
#include <stdio.h>
int main()
{
int pass = 3456;
int value;
printf("enter a your password: ");
scanf("%d", &value);
if (value == pass)
{
printf("password correct\n");
}
else
{
printf("password is incorrect\n");
}
return (0);
}
Step by step
Solved in 3 steps with 1 images
- Using the Java language, write a program that takes two words as input from the keyboard, representing a password and the same password again. For example,websites ask users to type their password twice when they register to make sure there was no typo the first time around. Use the conditional operator when evaluating the password.On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved by executingcout << fixed << setprecision(2); once before all other cout statements. Ex: If the input is: 440.0 (which is the A key near the middle of a piano keyboard), the output is: 440.00 466.16 493.88 523.25 554.37 Note: Use one statement to compute r = 2(1/12) using the pow function (remember to include the cmath library). Then use that r in subsequent statements that use the formula fn = f0 * rn with n being 1, 2, 3, and finally 4.On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved by executingcout << fixed << setprecision(2); once before all other cout statements. Ex: If the input is: 440.0 (which is the A key near the middle of a piano keyboard), the output is: 440.00 466.16 493.88 523.25 554.37 Note: Use one statement to compute r = 2(1/12) using the pow function (remember to include the cmath library). Then use that r in subsequent statements that use the formula fn = f0 * rn with n being 1, 2, 3, and finally 4. I am having trouble putting them on one sentence line.
- On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved by executingcout << fixed << setprecision(2); once before all other cout statements.Write an application in Python that allows a user to play the game Bulls and Cows against a computer. The game works as follows: The computer chooses a 4-digit number in secret. The digits must all be different. The user then guesses the number and the computer will provide the number of matching digits. If the matching digit is in the right position it is a "bull", if it is in a different position it is a "cow". If the user guesses a number with repeat digits that is partially correct the rule is that a correct digit can only count once and bulls count before cows. Your program should report the number of attempts the user needed to guess the number and it should let a user play as many times as they wish in a single session. Hint: you may find it easier to store these numbers as strings or in lists rather than as plain integers. You must use the attached templates. Write the code that is needed to complete the three functions in the bulls_and_cows module and the play_game function…Write a program in which the user to type his own ID, if the ID is valid it will ask him to enter his password, if the password is correct the program will print the name of the user, otherwise the program will print Incorrect Password and if the ID does not exist , the program will print Incorrect ID.
- Write a c++ program to prompt the user to enter his name. The program should ask the user toguess the login password (generated randomly to be between 1000 – 9999). The user will tryto guess the password digit by digit as follows:Guess the first digit of the password ****: 2Sorry wrong guessing!!!.Guess the first digit of the password ****: 1WOW you have a correct guess.Guess the second digit of the password 1***: 5WOW you have a correct guess.Guess the third digit of the password 15**: 3Sorry wrong guessing!!!. The user will have only three chances to guess a specific digit from the password. After 3successive wrong guesses a $50 balance will be deduced from the user balance. For each correctguessing a $100 dollar will be added to his balance if it is a correct guess from the first trial,and a $75 dollar will be added to his balance if it is a correct guess from the second trial. Notethat the user is granted a balance of $200 dollar on the game start.The user win a game round if he…write a C++ program that determines whether or not a password is good. A good password is defined suchthat it is at least 8 characters long and contains at least one uppercase letter, at least one lowercase letter, andat least one number. Write a program that reads a password from the user, if the user enters a bad password,your program should ask the user to enter a password again. Count and display the number of attempts thatwere needed before a good password was generated.In Python, A sales event at Trader Jane's is reducing some items by 25%. Store that value to a properly named constant. Write a program that functions like a cashier terminal for one item. Some items are subject to 7% sales tax and some are not. Use a constant for the sales tax value, too. Write a program for Trader Jane's that runs as shown next: Enter the ticket price of the item 100 Is this item reduced y/n? y is this item taxable y/n? y Here is your bill Original price $100 Reduction during event $25.00 Final price $75.00 7% Sales tax $5.25 Total amount due $80.25 Plan each program by writing pseudocode. Write all of your pseudocode as comments immediately after your name and SPC ID#. Add more comments as needed in each program to explain your code. Choose descriptive variable names in all programs. Currency format. There should be no space between the $ sign and the first digit. See sep on page 66 to cancel the space automatically added when print items are separated by…
- Write a program that coverts a zip code to a bar code. The bar codes use large and small bars. We will use : as a small bar and | as a large bar. Each digit has its own bar pattern. 1 is :::|| 2 is ::|:| 3 is ::||: 4 is :|::| 5 is :|:|: 6 is :||:: 7 is |:::| 8 is |::|: 9 is |:|:: 0 is ||::: The barcode also includes a check digit. The final digit added to the bar code verifies the previous numbers are correct. To Determine the checksum: Add all the digits together Determine what needs to be added to make the total a multiple of 10 The bar code also always starts and ends with a large bar. This is used by the scanner to align the letter. Drexel's Zip Code is 19104 The check digit is 5. The sum of the digits is 1+9+1+0+4 = 15. To make 15 a multiple of 10, we need to add 5. The bar code will be |:::|||:|:::::||||::::|::|:|:|:| The majority of work in this problem is done by digit. It makes sense to store the zip code as a string, not as an integer. Write the function checksum(zip)…Write a program that coverts a zip code to a bar code. The bar codes use large and small bars. We will use : as a small bar and | as a large bar. Each digit has its own bar pattern. 1 is :::|| 2 is ::|:| 3 is ::||: 4 is :|::| 5 is :|:|: 6 is :||:: 7 is |:::| 8 is |::|: 9 is |:|:: 0 is ||::: The barcode also includes a check digit. The final digit added to the bar code verifies the previous numbers are correct. To Determine the checksum: Add all the digits together Determine what needs to be added to make the total a multiple of 10 The bar code also always starts and ends with a large bar. This is used by the scanner to align the letter. Drexel's Zip Code is 19104 The check digit is 5. The sum of the digits is 1+9+1+0+4 = 15. To make 15 a multiple of 10, we need to add 5. The bar code will be |:::|||:|:::::||||::::|::|:|:|:| The majority of work in this problem is done by digit. It makes sense to store the zip code as a string, not as an integer. Write the function checksum(zip)…' at a certain school, student email addresses end with @student.college.edu, while professor email addresses end with @prof.college.edu. write a program in python that first asks the user how many email addresses they will be entering, and then has the user ener those addresses. after all the program should print out a message indicating either that all the addresses are student addresses or that there were some professor addresses entered