Charge Account Validation
Write a
5658845 4520125 7895122 8777541 8451277 1302850
8080152 4562555 5552012 5050552 7825877 1250255
1005231 6545231 3852085 7576651 7881200 4581002
Initialize a one-dimensional array with these values. Then use a simple linear search to locate the number entered by the user. If the user enters a number that is in the array, the program should display a message saying the number is valid. If the user enters a number not in the array, the program should display a message indicating it is invalid.
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
STARTING OUT WITH C++ MPL
Additional Engineering Textbook Solutions
Computer Science: An Overview (12th Edition)
Concepts of Programming Languages (11th Edition)
Starting Out with Programming Logic and Design (4th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
C++ How to Program (10th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
- (Numerical) Write an assignment statement to calculate the nth term in an arithmetic sequence. This is the formula for calculating the value, v, of the nth term: v=a+(n1)d a is the first number in the sequence. d is the difference between any two numbers in the sequence.arrow_forward18. Tom and Jerry opened a new lawn service. They provide three types of services: mowing, fertilizing, and planting trees. The cost of mowing is $35.00 per 5,000 square yards, fertilizing is $30.00 per application, and planting a tree is $50.00. Write an algorithm that prompts the user to enter the area of the lawn, the number of fertilizing applications, and the number of trees to be planted. The algorithm then determines the billing amount. (Assume that the user orders all three services.) (9)arrow_forwardDiscrete Mathematics: Assignment details: Replace all the 0 (Zero) digits in your ID by 4. Example: If your ID is 38104680, it becomes 38144684 Take the first 6 digits and substitute them in this expression (( A + B) / C) * ((D-E)/F)-2) according to the following table; Letter Replace by Digit Example Digit A 1st 3 B 2nd 8 C 3rd 1 D 4th 4 E 5th 4 F 6th 6 After substitution your expression will be similar to this (( 3 + 8) / 1) * ((4-4)/6)-2). Draw a rooted tree that represents your expression. What is the prefix form of this expression. 3.What is the value of the prefix expression obtained in step 2 above?arrow_forward
- in C-Languagearrow_forwardpythonarrow_forwardCount of Guess Create a JAVA program to generate a random number in the range [1,10] and then prompt the user to guess a number until the user guesses the correct random number generated. The program should print the number of attempts in which the user enters the correct number.arrow_forward
- Warm-up: Integer Operations Write a program that asks the user to enter two integers and prints the Difference, Product, Area of an Ellipse, and Average of these numbers. Here is an example of the execution of the program:arrow_forwardPYTHON CODE Reza Enterprises sells tickets for buses, tours, and other travel services. Because Reza frequently mistypes long ticket numbers, Reza Enterprises has asked his students to write an application that shows if a ticket is invalid. Your application/program tells the ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you lose the last digit of the number, then divide by 7, the remainder of the division is exactly the same to the last dropped digit. This process is shown below: Step 1: Enter the ticket number; for example 123454 Step 2: Remove the last digit, leaving 12345 Step 3: Determine the remainder when the ticket number from step 2 is divided by 7. In this case, 12345 divided by 7 leaves a remainder of 4. Step 4: Display a message to the ticket agent indicating whether the ticket number is valid or not. If the ticket number is valid, save the number to a .txt file called “tickets.txt” and continue to loop your program asking…arrow_forwardRacket code only please - primeTest It takes as input any positive integer n and returns true if the absolute value of the polynomial 8n2 − 488n + 7243 is a prime number. For example, the invocation (primeTest 5) should return true. - primeTestSeq This takes two arguments, a low bound and an upper bound. It determines what percentage of the integers between the lower bound and the upperbound are, according to primeTest, a prime number. For example, the invocation (primeTestSeq 1 60) should return 100.arrow_forward
- Python loopsarrow_forwardProgramming codearrow_forwardmystery_value = 5 #You may modify the lines of code above, but don't move them!#When you Submit your code, we'll change these lines to#assign different values to the variables. #Write a program that divides mystery_value by mystery_value#and prints the result. If that operation results in an#error, divide mystery_value by (mystery_value + 5) and then#print the result. If that still fails, multiply mystery_value#by 5 and print the result. You may assume one of those three#things will work.##You may not use any conditionals.# #Add your code here!arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage