uppercases, lowercases, and spaces t spaces are counted as letters).
Q: 1. [LO 1, LO 2, LO 3 & LO 4, Treasure Hunter Description You are in front of a cave that has…
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: Example: the screen appears as follows: Enter 3 characters (A-Z)? AHMED No. of characters are= 5
A: As in the question, no programming language is mentioned. I am using Python language to do the…
Q: 30- Variable names must begin with • Number O · Letter $• C #
A: Variables names must begin with
Q: 7. Test Average and Grade Write a program that asks the user to enter five test scores. The program…
A: /*Java Program that ask user to enter 5 test scores and displays letter grade for each score and…
Q: Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south,…
A: the answer is given below:-
Q: Many documents use a specific format for a person's name. Write a program whose input is: firstName…
A: Program description : Java program that prompts user to enter the name string from the console. Then…
Q: Exercise 1 The following codes will show the difference between reference by value or address.…
A: Difference between call by value and call by reference Call by value Call by reference A…
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A: The errors in the following program are:-
Q: , c) write a piece of code in C# that calculates the area of a triangle displaying the area in the…
A:
Q: ex1="I like numbers containing 7 such as 77, 177, 7897, 6757, 77097, but I do not like numbers…
A: Since there are multiple questions posted, the only first question can be solved according to…
Q: mary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and…
A: The given problem is to be solved using Python programming language where the program will get a…
Q: Many documents use a specific format for a person's name. Write a program whose input is: firstName…
A: Note: Programming language is missing in the question. So we will answer this program in Python…
Q: Many documents use a specific format for a person's name. Write a program whose input is: firstName…
A: // Import the packageimport java.util.Scanner; // Create LabProgram Classpublic class Main{ //…
Q: #include using namespace std; const int SECS PER MIN = 60; const int SECS PER HOUR = 3600; int…
A: Required:
Q: *11.15 (Area of a convex polygon) A polygon is convex if it contains any line segments that connects…
A: Program: /**ConvexPolygon.java**/ import java.util.Scanner; public class ConvexPolygon { public…
Q: This program segment display the sum of the series [ 9 + 99 + 999 +9999 .....] * .for only ten terms…
A: Which program segment display the sum of the series [9+99+999+9999....] for only ten terms
Q: AC variable cannot start with O An alphabet O A number A special symbol other than underscore Both…
A: The Answer is in given below step
Q: Program statement in programming language 'PASCAL' usually ends with a a. colon b. semicolon c.…
A: Required: Program statement in programming language 'PASCAL' usually ends with a
Q: #include #include using namespace std; int NormalizeGrade (int grade) { const int upperBound = 76;…
A: - We need to show the result of the lines combined. - The program is in C++.
Q: Engineering Math Courses are: ['Algebra', 'Trigonometry', 'Geometry', 'Solid Mensuration',…
A: # declaring tuple mathCourses mathCourses = ('Algebra', 'Trigonometry', 'Geometry', 'Solid…
Q: #include using namespace std; int main() int length, width, area; area - length • width; length -…
A:
Q: #include // this line can be placed second instead of first #include // this line can be placed…
A: Approach: Import the essential header. Defining the main method. Initialize the symbolic constant…
Q: Complete the below code #include #include using namespace std; void main() { int num1, num2,…
A: The complete code is given as under :
Q: 3.28 LAB: Name format Many documents use a specific format for a pėrson's name. Write a program…
A: According to the information given:- We have to take input in the format of first, middle and last…
Q: String character = "Leia"; String planet = "Alderaan"; if (character.equals("Rey")) { planet =…
A: The output of the given question is given below.
Q: 5. Alphabetic Telephone Number Translator Many companies use telephone numbers like 555-GET-FOOD so…
A: Python program code: a=input("Enter a telephone number XXX-XXX-XXXX: ") #user inputb=a.split('-')…
Q: 2. Find mistakes. (a) specify the location of the errors. If you find no error at all, write "No…
A: Line number 2: Should be ; after std. Line number 5: Should be { not (. Line number 8: Should be…
Q: #include using namespace std; int main() { double height, cub,mass, val; cout « "Input height : ";…
A: Pseudocode: start Read the height and water calculate mass=cub*1000 calculate…
Q: #include using namespace std int main() { int x=6; int y=10; int 7-6:
A: Please find the answer below :
Q: #include #include using namespace std; int main() int x=9,z; cin>>z; z=sqrt(x); cout<<"\nthe value…
A:
Q: #include using namespace std; int main() width 15 area - length width; cout <« "The area is " <<…
A: Following syntax errors are present in above code: In line 5 there are following syntax error in…
Q: (Area and perimeter of a rectangle) Write a program that displays the area and perimeterof a…
A: Objective: This program would display the area and perimeter of a rectangle whose width would be 5.3…
Q: E zyBooks catalog Many documents use a specific format for a person's name. Write a program whose…
A: take the name as a single line input split it on the basis of space " " save it in an array declare…
Q: 2) Minimize the following DFA (use the tabular method explained in the lecture notes and class).…
A:
Q: #include // this line can be placed second instead of first #include // this line can be placed…
A: Explanation: The modified C++ program to calculate the expected time taken to fall from specific…
Q: change normal body temperature to 36.5–37.5 °C #include using namespace std; int main() { float…
A: Given, Change the code so that normal body temperature is 36.5–37.5 °C
Q: T/F 2. The prefix and postfix increment and decrement operators may be used on Integer cases.
A: #include <stdio.h> int main() { int var1 = 5, var2 = 5; // 5 is displayed // Then,…
Q: #include using namespace std; int main() { int n,r,sum=0,temp; cout>n; temp=n; while(n>0) { r=n%10;
A: Answer:
Q: Fill in the blanks. Provide the number immediately before and after the given number in the given…
A: here we have given value of before and the after of present values.
Q: 30- Variable names must begin with O • Number • Letter • $
A: Answer: The correct option is (b) => Letter
Q: y favorite number is " + 7L what is the correct data type that t
A: Given: + 7L
Q: (Table of Squares and Cubes) Using only the techniques you learned in this chapter, write a program…
A: Program code: #include <stdio.h> int main(void) { int num=0;…
Q: #include #include int main() { int year = 2019; cout << "World Cup France cout << "The square of…
A: Please refer below output: firstly we know, int year=2019; now there are two print statements after…
Q: The following declaration, program, and program segment has errors. Locate as many as you can. A)…
A: GIVEN: The following declaration, program, and program segment has errors. Locate as many as you…
Q: Surface Area of sphere is A = 4 π r **2 Convert this into function and pass any…
A: Given: The surface area of the sphere is A = 4 π r 2 Convert this into function and pass any value…
Q: Perimeter and area of any triangular using the equation formula as shown below. The values of a, b,…
A: Question: This code segment find the Perimeter and Area of any triangular using the equation formula…
Step by step
Solved in 2 steps
- Write a program that lets the user enter the total rainfall for each of 12 months (starting with January) into an array of doubles. The program should calculate and display (in this order): the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts. Months should be expressed as English names for months in the Gregorian calendar, i.e.: January, February, March, April, May, June, July, August, September, October, November, December. Do not accept negative numbers for monthly rainfall figures. When a negative value is entered, the program outputs "invalid data (negative rainfall) -- retry" and attempts to reread the value. NOTE: Decimal values should be displayed using default precision, i.e. do not specify precision.2. A store owner wants the total sales for 2020. Write a program that will load an array with 12 months of sales. Use iomanip to make a nice-looking chart that shows the monthly sales, the month with the highest sales, lowest sales, and average for the year sales. January ……………. $50,000 February…………… $60,000 March ……………….$80,000 April ………………..$106,000 May …………………..$50,000 June ………………..$190,000 July ………………….$900,000 August …………… $102,000 September ………..$70,000 October …………..$700,000 November………… $90,000 December …………$90,000 Total Sales for the year 2020 was ………………….………$ The month with highest sales was ****** at ………..$ The month with lowest sales was ****** at ………...$ The average of sales for the year was ……………………$ C++The Lo Shu Magic Square is a grid with 3 rows and 3 columns shown below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly The sum of each row, each column and each diagonal all add up to the same number. This is shown below: Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Do not use two-dimensional array. Each one the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is magic square Processing Requirements Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns…
- Write a program that uses a 2-D array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of the following methods with their appropriate parameters: a.) getData: This method reads and stores the data in the 2-D array. b.) averageHigh: This method calculates and returns the average high temperature of the year. c.) averageLow: This method calculates and returns the average low temperature of the year. d.) indexHighTemp: This method returns the index of the highest temperature in the array. e.) indexLowTemp: This method returns the index of the lowest temperature in the array. Use the following input: High temp for each month: 30 40 45 60 70 90 89 95 79 90 70 40 Low temp for each month: 10 -10 20 30 50 75 85 79 50 80 30 20The Lo Shu Magic Square is a grid with 3 rows and 3 columns shown below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly The sum of each row, each column and each diagonal all add up to the same number. This is shown below: Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Do not use two-dimensional array. Each one the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Processing Requirements - c++ Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns in the array const int MIN = 1; // The value of the smallest number const int MAX = 9; // The value of the largest number //…Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of the following methods: Method getData: This method reads and stores the data in the two-dimensional array. Method averageHigh: This method calculates and returns the average high temperature of the year. Method averageLow: This method calculates and returns the average low temperature of the year. Method indexHighTemp: This method returns the index of the highest temperature in the array. Method indexLowTemp: This method returns the index of the lowest temperature in the array.
- RetailItem Class Write a class named Retailltem that holds data about an item in a retail store. The class should have the following fields: • description. The description field references a String object that holds a brief description of the item. • unitsOnHand. The unitsOnHand field is an int variable that holds the number of units currently in inventory. • price. The price field is a double that holds the item's retail price. Write a constructor that accepts arguments for each field, appropriate mutator methods that store values in these fields, and accessor methods that return the values in these fields. Once you have written the class, write a separate program that creates three RetailItem objects and stores the following data in them: Description Units on Hand Price Item #1 Jacket 12 59.95 Irem #2 Designer Jeans 34.95 [rem #3 Shirt 24.95Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions: Part a: Function getData: This function reads and stores data in the two- dimensional array. Part b: Function averageHigh: This function calculates and returns the aver- age high temperature for the year. Part c: Function averageLow: This function calculates and returns the average low temperature for the year. Part d: Function indexHighTemp: This function returns the index of the highest high temperature in the array. Part e: Function indexLowTemp: This function returns the index of the lowest low temperature in the array. (These functions must all have the appropriate parameters.) #include <iostream> using namespace std; const int NO_OF_MONTHS = 12; void getData(int twoDim[][2], int…Write a program that does the following: • Reads an integer from the user that represents the number of the students in a class. • Reads the scores of the students from the user and stores them in an array. • Calculates and prints the average of the students with a passing grade (above or equal to 60). Hints: Assume that the scores of the students are integers between 0 and 100 (inclusive) • Assume that there is at least one student in the class with a passing grade. Using java Sample run 1: Enter the number of students in the class: 3 Enter the scores of 3 students: 90 80 40 The average of the students with a passing grade is 85.0 Sample run 2: Enter the number of students in the class: 5 Enter the scores of 5 students: 90 80 40 60 70 The average of the students with a passing grade is 75.0
- Write a program named as reverse.c that reads a message, then prints the reversal of the message. The output of the program should look like this: Enter a message: Don ’t get mad, get even. Reversal is : .neve teg ,dam teg t ’noD Hint: Read the message one character at a time (using getchar) and store the characters in an array. Stop Reading when the array is full or the character read is ‘\n’. The framework of reverse.c is as below: /* reverse.c */ #include #define N 50 int main(){ int arr[N],i=0; char ch; printf("Enter a message: "); /* Put code here to get input from user by using getchar() */ printf("Reversal is: "); /* Put code here to print out the reversal by using putchar()*/ printf("\n"); return 0; }Create a program which has:1. The following arrays created: a. an array of double with 5 elements, dArr b. an array of long, lArr, with 7 elements and initialized at the time of creation with the values 100000, 134567, 123456, 9, -234567, -1, 123489 c. a 2 dimensional array of integer, with 3 rows and 5 columns, iArr. d. an array of char with your name initialized in it. Big enough for 30 typable characters, sName.2. define 3 variables, , cnt1 and cnt2 (short data types) as general purpose counters and a long double total3. define 1 long variable called highest4. a for loop to put a random number into each of the elements of the array of double, dArr. Use rand() and seed a random starting point with srand() as demonstrated in Chapter . Use a for loop to display all of the values in dArr. 5. another for loop to add up the array of double, dArr, into the variable…In java Write a program that uses a 2-D array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of the following methods with their appropriate parameters:a.) getData: This method reads and stores the data in the 2-D array.b.) averageHigh: This method calculates and returns the average high temperature of the year.c.) averageLow: This method calculates and returns the average low temperature of the year.d.) indexHighTemp: This method returns the index of the highest temperature in the array.e.) indexLowTemp: This method returns the index of the lowest temperature in the array.Use the following input:High temp for each month: 30 40 45 60 70 90 89 95 79 90 70 40Low temp for each month: 10 -10 20 30 50 75 85 79 50 80 30 20