Create a JavaScript file that will display the following using any type of Loop (for, while or do...while): 1. Print all numbers between -10 and 19. 2. Print all even numbers between 10 and 40. 3. Print all odd numbers between 300 and 333. 4. Print all numbers divisible by 5 and 3 between 5 and 50.
Q: In Python, Use num.txt file (below). create a program that opens num.txt, a file consisting of a…
A: I give the code in Python along with output and code screenshot
Q: (python) Create a loop that runs 5 times and inside that loop, create a loop that runs until a…
A: Here, Code instruction is given.
Q: We can read the file without opening it, Choose whether given statement is true or false. a. True b.…
A: File Opening
Q: The file words.txt on the book’s website contains 87,314 words from the English language. Write a…
A: Importing java files for scanner function, exception and file handling. Declaring the adequate…
Q: Write a program that allows the user to enter name and phone number. Have the program accept input…
A: Please find the answer below :
Q: Write a Java program that: Reads a file Counts the number of lines Counts the number of words…
A: Write a Java program that will find the following things: Counts the number of lines Counts the…
Q: Create a JavaScript file that will display the following using any type of Loop (for, while or…
A: This question can be answered by using the concepts of JavaScript. The program needs to print all…
Q: The pressure of a gas changes as the volume and temperature of the gas vary. Write a program that…
A: Files are used to store data permanently in a storage device. In the file handling feature of C++…
Q: Write a program that prints the number of palindromes in this file ..../englishWords (tips , open…
A: I am using the python language and concept used is to compare the reversed and normal string…
Q: Implement Method getPercentage that takes two inputs : grade and totalGrade and outputs the grade…
A: Use a Scanner instance where we can load the file input.txt and use FileWriter instance to write to…
Q: You will have an orthogonal triangle input from a file and you need to find the maximum sum of the…
A: Please give positive ratings for my efforts. Thanks. ANSWER using System;using…
Q: PYTHON PROGRAM Write a program that will ask a user to input a word and that will check if…
A: Take user input Check if it's a palindrome word or not if YES: Save the word in Palindromes.txt file…
Q: Write a program that reads a text file and prints its odd lines on the console
A: In the solution of given problem, we need to open text file in read mode, then use the readlines()…
Q: an orthogonal triangle input from a file and you need to find the maximum sum of the numbers…
A: the code is an given below : Below is code for the asssignment given. You can read input from file…
Q: NEED HELP PLEASE! Write a Java program to read a text file (command line input for file name),…
A: import java.io.*; public class Test{ public static void main(String[] args) throws IOException {…
Q: Write a loop that will print the numbers from 0 to 1000 in steps of 50. When the number is 800 or…
A: Algorithm: 1. after each iteration, i will be incremented by 50 ,i+=50 can also be written as i=i+50…
Q: Scanners are handy for reading input that is stored in a file. For this exercise, create a file…
A: 1.Make a file num.txt and input the given numbers.2. Read each line from the file using while and…
Q: Write a program using the random number generator to create a list of random rainfall measurements…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: h. Pretend you have a file called 'file.txt'. Check to see if the file exists, if so print out the…
A: 1. We use the 'os.path' module to check whether a file exists. 2. We use the mode function to check…
Q: Write a code that reads integers from a file named input.txt and compute their product. We do not…
A: Introduction of the Program: The Java program reads the text file and stores the numbers from the…
Q: In Java - intellij Write the following program WITHOUT using the file function
A: I Have answered this question in step 2.
Q: Write a program that allows the user to enter name and phone number. Have the program accept input…
A: DirectoryWrite.java import java.io.FileWriter;import java.io.IOException;import…
Q: InputOutput Class: write a program that carries out the following tasks: o Create an object of type…
A: A) Programming instructions: Include necessary header files. Create a class, InputOutput class. In…
Q: Write a do-while loop that continues to prompt a user to enter a number less than 100, until the…
A: Program: //include the header file import java.util.Scanner; //defintion of class public class…
Q: Use the following link to write the program: https://www.onlinegdb.com/ Copy your work with output…
A: Mathematical calculations can be done using mathematical expressions in C. Some of the useful…
Q: Code with comments and output screenshot is must for an Upvote. Thank you! Using Java: Create a…
A: import java.io.*; import java.util.*; public class sort_class implements Serializable_class {…
Q: In Python, Use the file named numbers.txt numbers.txt ——————- 10 25 36 45 89 42 54 —————— to create…
A:
Q: Create a java profram that search a specific word in text file. Also count how many times word…
A: The required task can be performed by the following coding example : //importing the necessary…
Q: (InputMismatchException) Write a program that prompts the user to read two integers and display…
A: 1.crete a class main.2. take input from user.3. take first and the second number which is to be…
Q: The lines below are the content of the file named tyries.txt Baby shark doo doo doe doo doo doo Baby…
A: Based on python
Q: program that reads the file named randomPeople.txt sort all the names alphabetically by last name…
A: Code : import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.FileReader;import…
Q: i got this error when I try to compile my code. What should I do? Should i change the name of my…
A: We have two option to solve this error: 1) If both class(CompactDisc & Song) in one class then,…
Q: you must create the data files with a text tool, such as Notepad exampleThree In the while…
A: Given: you must create the data files with a text tool, such as Notepad exampleThree In the…
Q: You will have an orthogonal triangle input from a file and you need to find the maximum sum of the…
A: As programming language is not mentioned we are providing you answer in C#
Q: Create a flex file which recognizes if a given string is a word or a number. (Here we have 3…
A: As per the QnA policy, we will be answering only the first question.
Q: You will have an orthogonal triangle input from a file and you need to find the maximum sum of the…
A: Program Plan: Define checkPrime() function to check whether a number is a prime number or not.…
Q: Print the file on the BlueJ console Java Filename: input.txt Number of lines: 5 Longest Line:…
A: The resultant Java code is:import java.io.*;import java.util.Scanner; /*** Write a description of…
Q: Create a MessageDecoder program that reads from a file (one character at a time), and writes all…
A: #include <stdio.h>#include <fcntl.h> int main(int argc, char const *argv[]){ // open…
Q: Write a program to read and store four student's car number and their distances, sort them into an…
A: For this problem, a class Student with instance variables id, car number and distance is created.…
Q: In Python, Use num.txt file (below). create a program that opens num.txt, a file consisting of a…
A: I give the code in Python along with line by line explanation and also provide the output and code…
Q: In Python, Use number.txt file (below). create a program that opens num.txt, a file consisting of a…
A: The above question is solved in step 2 :-
Q: PYTHON PROGRAMMING Write a program that will ask a user to input a word and that will check if the…
A: Basically, user will be asked to enter number of strings as input, until one wants to quit oneself…
Q: Implement the following: 1) Use a loop to request a user input from the console. 2) The loop should…
A: I have used the online python compiler for this code. But the compiler does not matter, the code is…
Q: Please use JAVA for the coding! Write a program that converts a number from binary to decimal.…
A: A binary number can be denoted as a number that is only represented by the two numbers 0 and 1 and…
Q: You will have an orthogonal triangle input from a file and you need to find the maximum sum of the…
A: Code execution:
Q: The program should start by asking the user for the word to be searched for. Then the words in the…
A: Check whether file name is passed as argument. If argument is not passed setting to default…
Q: Exempel c:\>java labb2 Enter the word to search for>hello The file 'wordlistl.txt' contains 55899…
A:
Q: You will have an orthogonal triangle input from a file and you need to find the maximum sum of the…
A: I have provided solution in step2
Q: enter this task, ask the user for a word and then search for a file to see if that word is among the…
A: Importing modules Create file descriptor Initializing words array Initializing file reader Taking…
Create a JavaScript file that will display the following using any type of Loop (for, while or do...while):
1. Print all numbers between -10 and 19.
2. Print all even numbers between 10 and 40.
3. Print all odd numbers between 300 and 333.
4. Print all numbers divisible by 5 and 3 between 5 and 50.
Step by step
Solved in 3 steps with 2 images
- NumberFun.py # using multiple functions. # copy/paste this program to run it first, you are supposed to use Google Chrome as Internet Browser for this course. # 1. calculate sum of the first n natural odd numbers, e.g.:1,3,5,7,9... def totalN(n): totalN = 0 for i in range(1,2*n+1,2): totalN = totalN + i return totalN # 2. calculate sum of the square of the first m natural odd numbers, e.g.:1,9,25,49,81... ### After you define/write/complete the function totalMSquare(m), remove the # sign as below to ENABLE next line of code #def totalMSquare(m):### YOUR TURN TO DEFINE/WRITE/COMPLETE function totalMSquare(m) as below, based on totalN(n) Please based on the first function, add more statements for the second function. You can copy/paste the sample program to run and see how it works to make sense first. 2. Don't delete the statements/codes/comments for this program, but just add more statements for the second function. (if deleted, points will be deducted.)Python Coding-(On Pycharm Community Edition) Create a mini-lottery with TEXT ticket. The user is going to save three numbers in a text file - those three numbers are from 1-9. In Python, create a program that reads those three numbers from the text file (ticket) Use a random number generator to draw three random numbers Compare the text ticket and the random numbers. If they match number (see below), output the prize The numbers can be in any order the random numbers can be duplicates, so be careful how you count! This work in a similar way to mini-assignment number 48 - but you DO NOT have to write to a text file. Have the user enter the numbers into the text file. Append the numbers read from the text file to a list read each number from the list and compare it to the randomly generated numbers you come up with One number match - free ticket Two numbers match - $2.00 Three numbers match - $10.00 -you don't have to complete bonus, it would be great if you could-…Using for - loops, generate 10 random numbers between 10 to 30 inclusive. Find the number, the total of even values and their average. Display the three computed values (number, total, average). Save your file as Q3.Java and upload it Attach File
- JAVA: Create a "While" loop code to compute and print the sum of all squared integers between 2 and 5. (inclusive)Java Programming: Using StringBuilder and a for loop, create a String that consists of the numbers 1 to 10 with a comma in-between. Make sure to use the loop to add the numbers to the String!JavaScript Write JavaScript programs to do the following: (1) At one college, the tuition for a full-time student is $8,000 per semester. It has been announced that the tuition will increase by 3 percent each year for the next 5 years. Write a program with a loop that displays the projected semester tuition amount 5 years from now. (2)Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop should then prompt the user to enter each of his or her expenses for the month and keep a running total. The loop should finish when total of the expenses, is at or over budget. The program should print the amount of money left over after the expenses. (3) Write a program that calculates how many days it takes to accumulate at least $1,000,000 if someone deposits one penny on the first day, two pennies the second day, four pennies on the third day and continues to double each day. The output should display the number of days. (4) Suppose a random…
- Python Coding-While Loops (In PyCharm Community edition) Create a while loop that SUMS up ALL the numbers given from an initial number and an ending number. Example would be : Input1 : What is the first number? 0 Input2 : What is the last number? 3 DO NOT SHOW but these are the computations inside the code : 0 + 1 + 2 + 3 = 6 This is the Output : The sum of all the number from 0 to 3, is 6 In the code you are going to use a total variable and add each additional time it runs through the loop to that total. REMEMBER the assignment from the first unit of programming where we used this formula : BUT you are going to create your own method using a while loop to emulate what formula accomplishes WITHOUT using this formula. The user will put in the first number and the last to be SUMMED - you will use the while loop to calculate all of the additions leading to the final number.Language: Python with Turtle Write a program that will have Turtle draw a hexagon. • You should: 1. Have hexagon sides that are 50 pixels long 2. Use a for loop • Hint: Figure out how much Turtle will need to turn after drawing each side of the shape to add up to the total 360 degrees.PS Links Write a Java program below that does the following: /* Program randomly selects secret (1) Generate a random number between 5 and 192 (both inclusive) and ask the user to guess it (2) Inside a while loop, repeat prompting the user for a new guess if incorrect. If the user's guess is more than 10 away from secret number, the program will provide a hint: "Guess higher" or "Guess lower" (3) Print "You guessed my number in X tries and used Y hints" when the number 122 */ Pick a number between 5 and 192: 100 Guess again. Guess higher. user gets the number correct. 150 Guess again. Guess lower. See sample output in box. 125 For this DQR, I strongly recommend that you actually code the program in repl.it and test it thoroughly. You may begin with the code I provided in the code along on 3/22. Guess again. 135 Guess again. Guess lower. 120 Guess again. 121 Guess again. 122 Blocked You guessed my number in 7 tries and used 3 hints. 7:54 29°F Clear 1/31/ O Type here to search 近
- Using for-loops, generate 10 random numbers between 10 to 30 inclusive. Find the number, the total of even values and their average. Display the three computed values (number, total, average). Save your file as Q3.Java and upload it Attach File Browse My Computer# NumberFun.py # using multiple functions. # copy/paste this program to run it first, you are supposed to use Google Chrome as Internet Browser for this course. # 1. calculate sum of the first n natural numbers, e.g.:1,2,3,... def sumN(n): sumN = 0 for i in range(1,n+1): sumN = sumN + i return sumN # 2. calculate sum of the square of the first m natural numbers, e.g.:1,4,9,... ### After you define/write/complete the function sumMSquare(m), remove the # sign as below to ENABLE next line of code ####def sumMSquare(m):### YOUR TURN TO DEFINE/WRITE/COMPLETE function sumMSquare(m) as below, based on sumN(n) # 3. call two functions defined previously within main() function def main(): print("This program computes the total and total of squares of the first") print("N/M natural numbers.\n") n,m = input("Please enter a value for N and M: ").split(",") print("The total of the first", n, "natural numbers is", sumN(int(n)))### After you define/write/complete the function sumMSquare(m), remove…Write a complete program to generate a username based on a user's first and last name. Part One: Get a Valid First and Last Name ask the user for and read in their first and last name use a loop to validate the first name: it must be at least one character long and it must start with a letter use a loop to validate the last name: it must not contain any spaces Hint: use a nested loop. The outer loop will iterate until there is valid input. The inner loop will check each character in the String to see if any of them are whitespace. Part Two: Generate a Username generate a two-digit random number (i.e., a random number between 10 and 99, inclusive) create a username that is the following data concatenated: the first letter of their first name in lower case the first five characters of their last name in lower case; if the name is shorter than five characters, use the whole last name the two-digit number output the username to the user Additional Coding Requirements code…