.1.5 Consider the following snippet of code being tested: 1. Print “Please enter your age: “ 2. Read age 3. IFage>=60 4. Print “Qualify for pensioner’s discount” 5. ELSE 6. Print “Do not qualify for pensioner’s discount” 7. ENDIF Assume you apply the following test case to the code snippet above: Test Case 1 : age = 93 Q.1.5.1 Calculate the statement coverage achieved for Test Case 1 and provide a brief explanation for your response. Q.1.5.2 Calculate
Q: C++ Code Mr. Naughty loves to play with balls. So, his friend, Mr. Nice, gave him n balls to play…
A: Code process The first line contains the same number n - the number of balls. Inext n lines contain…
Q: Suppose salary and bonus are variables of type double. Write an if-else statement that displays the…
A: Suppose salary and bonus are variables of type double. Write an if-else statement that displays the…
Q: Write code that takes the size of their foot from user and prints out suggested sandal size. Shoe…
A: To give a problem, we have to take value from the user and then checks a condition and show the…
Q: main.c 10. Lucky Customer by Jay Vince Serato E Run Tests We have a special promo here in our…
A: According to the Question below the solution: Output:
Q: You are given a positive integer x. Check whether the number x is representable as the amount of the…
A: Here have to determine about the sum of cube programming problem statement.
Q: In java (eclipse) write a program that inputs an integer. If the integer is greater than 100 or…
A: Required: write a program that inputs an integer. If the integer is greater than 100 or between 50…
Q: State whether true or false. The following code will throw an error: double a = 2; double b = 3;…
A: Since the programming language is not mentioned, I have verified the code using C++.
Q: eate a class named as Integer by using a logical NOT operation that converts the positive number in…
A: import java.util.*;public class Main{ public static void main(String[] args) { Scanner sc=new…
Q: Project description The problem here is to make change using the smallest number of American coins.…
A: Code: #include<stdio.h>#include<stdlib.h>int *change(int amount){ int *data =…
Q: CHALLENGE 1.2.3: Read multiple user inputs. ACTIVITY Write two cin statements to get input values…
A: #include <iostream> using namespace std; int main(){ int birthMonth; int birthYear;…
Q: When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making…
A: let us see the answer:- Below I have written the code in c++ iostream: iostream is an abbreviation…
Q: 4.20 LAB: Warm up: Automobile service cost (1) Prompt the user for an automobile service. Output…
A: In this first of all user get the menu of automobile services then user has to input which service…
Q: remaining, an int that defaults to 4. (Assume that any argument given is non-negative, no data…
A: The constructor ( __init__ ) accepts two optional arguments flavor, a str that defaults to 'Milk…
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A: #Code: import java.util.Scanner; public class LabProgram { public static void main(String[]…
Q: In admissions to military high schools, the age of the candidate should be between 13 - 17…
A: Java is a programming language. It contains extensive libraries (package). It can be used to create…
Q: A student makes the following argument. if I receive a good grade, the instructor teaches well. I…
A: Here we need to create a statement by taking reference from given data.
Q: K Chapter 4 Project - new Fall 10-21-20... Project Name: Chpt4_Project Class Name: Chpt4_Project…
A: Java program that accepts names of members on a tug of war team, computes their total weight, and…
Q: Write a statement that assigns numCoins with numNickels + numDimes. Ex: 5 nickels and 6 dimes…
A: PROGRAM INTRODUCTION: Import the required libraries. Start the definition of the main function.…
Q: If you are flying with an economy ticket, there is a possibility that you may get upgraded to…
A: Decision table is a method of describing the logical relationship as a visual representation ( in…
Q: Basic if-else expression. Jump to level 1 Write an expression that will cause the following code…
A: Solution: Algorithm Step 1: Input age from the user. Step 2: If the age is less than or equal to…
Q: 1. Using an if/else construct, write a program that will calculate a person's pay based on the…
A: As you have not specified programming language i have wrote it in c language. Algorithm: 1.Declare…
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A: Output Screenshot:
Q: Write an if-else statement for the following: If userTickets is less than 8, execute awardPoints =…
A: The main advantages of high-level languages are:- - human-friendly - machine-independent - easy to…
Q: a. You have arranged a party to celebrate 31 December 2020 and you have invited all your friends.…
A: rand() is used to generate random number rand() % 2 will give random 1 or 2 1 for head and 2 for…
Q: A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her…
A: Program Approach Make a method to return the total calories from number. Input the Fat Grams.…
Q: So if the new balance is $38.00 then the person must pay the whole $38.00; if the balance is S128…
A: CODE: JAVA PROGRAMMING LANGUAGE import java.util.*;import java.text.*;public class CreditCardBill{…
Q: 2.34 LAB: Input: Mad Lib Mad Libs are activities that have a person provide various words, which…
A: Answer :-
Q: Ask the user to enter a day of the week in 3 letters. * Respond with the meal plan for that day.…
A: PROGRAM: //Header file import java.util.Scanner; //Defining the class class WeeklyMeakPlan {…
Q: Duke Shirts sells Java t-shirts for $24.95 each, but discounts are possible for quantities as…
A: Java Code:- import java.util.*; public class Main { public static void main(String[] args)…
Q: (b) A triangle can be classified based on the lengths of its sides as equilateral. isosceles or…
A: Algorithm for the code: Step 1: Declare three sides of the triangle. Step 2: Enter three sides at…
Q: When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making…
A: // iostream in C++ is the standard library which implement stream based input/output capabilities…
Q: Declare fvar number :=null; svar number :=5; Begin goto > if fvar is null then >…
A: Declare fvar number :=null;//fvar=null svar number :=5;//svar=5 Begin goto…
Q: Based on what you learned about if-else and switch statements, could you implement the following…
A: Difference between if-else and switch if-else Based on the result of the expression in the if-else…
Q: (usually shown by a hand gesture) at the same time, and a winner is determined. In the game, Rock…
A: Code: import java.util.Scanner; public class Main { static Scanner scanner = new…
Q: Develop a letter-guessing game in this assignment. Requirements: 1). When the game begins, generate…
A: The java code is given below:
Q: Write an if-else statement for the following: If userTickets is greater than 8, execute awardPoints…
A: Hey, thank you for your question. To solve this problem, we can add a small coding snippet of…
Q: Mad Libs are activities that have a person provide various words, which are then used to complete a…
A: Introduction: The program simply prompts user to enter firstname, some location, and some number…
Q: 1. Write the java statement that assigns 1 to x if y is greater than 0 2. Suppose that score is a…
A: As you have asked multiple question we are answering first. If you want solution of any specific…
Q: 8. Write a program that calculates and displays a person's body mass index (BMI). The BMI is often…
A: Input weight, height Calculate BMI Use if conditional statements to check the person condition based…
Q: 1. Using an itjelse construct, write a program that will calculate a person's pay based on the…
A: Algorithm:1.import util package for scanner class 2.define a class named WorkPay2 3.In the main…
Q: Find the error(s) in the following code snippet and explain how to correct it (them): 1 class…
A: The function prototype of getIncrementedData is : int getIncrementedData() const {} which makes is…
Q: Q3/A- Estimate the result when you execute the following code by using Qbasic programming For m take…
A: Here is the result:
Q: 1. What is the output of the following code snipper? int num - 50; if (num > 50) : num - num -5:…
A: Question 1: The number is 50, so it will no enter the if clause and the output is 50. The answer is…
Q: Q4. Write a program that calculate the person's Body Mass Index (BMI). The BMI is often used to…
A: Given: Write a program that calculates and displays a person’s body mass index (BMI). The…
Q: Consider a vending machine that offers the following options: [1] Get gum [2] Get chocolate [3]…
A: Objective: An application should be built considering the functionalities of a vending machine. It…
Q: In an eye-glass shop, a customer can buy either a pair Ol Sngle prescription sunglasses. On each…
A: Since no programming language was mentioned in the question, I have solved in C language.
Q: : write a program with visual basic code to give the evaluation for different marks as follows.…
A: below is the code:
Q: Based on what you learned about if-else and switch statements, could you implement the following…
A: #include <stdio.h> int main() { int A; printf("enter a number :: ");…
Q: Craps is a single player dice game, that proceeds as follows: 1. the player rolls 2 six-sided dice…
A: Code: The python program is given by import random #function to calculate the sum of 2…
Q: Implement the following decision table using a nested if statement and multiple alternatives if…
A: Given:
Q.1.5
Consider the following snippet of code being tested:
1. Print “Please enter your age: “
2. Read age
3. IFage>=60
4. Print “Qualify for pensioner’s discount”
5. ELSE
6. Print “Do not qualify for pensioner’s discount”
7. ENDIF
Assume you apply the following test case to the code snippet above: Test Case 1 : age = 93
Q.1.5.1 Calculate the statement coverage achieved for Test Case 1 and provide a brief explanation for your response.
Q.1.5.2 Calculate the decision coverage achieved for Test Case 1 and provide a brief explanation for your response.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Each box of Healthy Crunch breakfast cereal contains a coupon entitling you to a free package of garden seeds. At the Healthy Crunch home office, they use the weight of incoming mail to determine how many of their employees are to be assigned to collecting coupons and mailing out seed packages on a given day. (Healthy Crunch has a policy of answering all its mail on the day it is received.) If the answer is a whole number, write a whole number. If it has one decimal place, write one decimal place. Otherwise, round off to two decimal places. If the answer is greater than 999, put a comma. a. Solve for Σx = Blank 1 b. Solve for Σy = Blank 2 c. Solve for Σx2 = Blank 3 d. Solve for Σy2 = Blank 4 e. Solve for Σxy = Blank 5 f. Solve for Pearson's r = Blank 6 g. Solve for the variance = Blank 7 h. Solve for the slope of the simple linear regression line = Blank 8 i. Solve for the y-intercept of the simple linear regression line = Blank 9 j. If the weight of the incoming mail is 30 lb, what…Please written by computer source Unit 4 - Lab – Individual Retirement Account Calculation Assignment An Individual Retirement Account (IRA) is a special bank / brokerage account that a person can use to save money for retirement. An individual can put up to $5,500 per year tax free and the money grows tax free until the person is ready to retire. The tax rules related to IRA’s are complex, but for this assignment, we’ll assume that the person puts in the same amount of money every year (up to $5,500) and the money grows at a constant interest rate. Write a Flowgorithm program that asks the user to input an annual IRA contribution (in dollars), and interest rate (percent), and a time period (years). Calculate the value of the IRA every year for the duration of the time period provided by the user. Be sure and provide user friendly prompts. Include a comment at the beginning of the program with your name, date, and a short description of the program.!!!FIRST READ EVERYTHING WRITTEN BELOW AND IF YOU CAN DO IT ONLY THEN START AND NO PLAGIARISM!!! Only use C++ to do this task. And I will only give thumbs up if you do not plagiarize from another Chegg or internet source. Also only if you will follow all the below instructions 100%. Only write typed answer. No handwritten. Code must visibly shows the functions and class. Attach the screenshot of output and code must be 100% complete and correct. Write a Twitter class that sets the Twitter user first (who is to be followed) and lets the client add up to 5 followers, which will be stored in an array with a capacity of 5. These users/followers could be in the form of string or Profile but both must be of same type. (Note that the followers are not stored as users, but as strings or Profiles). At any time, your main program should be able to remove any user, x from following another user, y (i.e., x is no longer in the array of followers of y). You are free to design your program as you…
- Help, I making a elevator simulator. I have to use polymorphism and object oriented programming to write this code. Can someone please help me improve this code I have. The remaining code is in the pictures. Any help is appreciated. Thank You! The simulation should have 4 types of Passengers: Standard: This is the most common type of passenger and has a request percentage of 70%. Standard passengers have no special requirements. VIP: This type of passenger has a request percentage of 10%. VIP passengers are given priority and are more likely to be picked up by express elevators. Freight: This type of passenger has a request percentage of 15%. Freight passengers have large items that need to be transported and are more likely to be picked up by freight elevators. Glass: This type of passenger has a request percentage of 5%. Glass passengers have fragile items that need to be transported and are more likely to be picked up by glass elevators. The simulation should also have 4 types…Please Help, Thank you! 3.25.2: Basic if-else. Write an if-else statement for the following: If numDifference is not equal to -15, execute totalDifference = -10. Else, execute totalDifference = numDifference. import java.util.Scanner; public class NumberDifference { public static void main (String [] args) { int totalDifference; int numDifference; Scanner scnr = new Scanner(System.in); numDifference = scnr.nextInt(); // Program will be tested with values: -14, -15, -16, -17. /* Your code goes here */ System.out.println(totalDifference); }}def calculate_growth_cycle(plant_name): if(plant_name == "strawberry"): print("### The life cycle of a strawberry ###\nA seed takes 110 days to reach maturity.") elif(plant_name == "cucumber"): print("### The life cycle of a cucumber ###\nA seed takes 76 days to reach maturity.") elif(plant_name == "potato"): print("### The life cycle of a potato ###\nA seed takes 120 days to reach maturity.") else: print('Your plant is available, please try "strawberry", "cucumber" or "potato"') Plants Growth Cycle Learning Objectives In this lab, you will practice: Defining a function to match the given specifications Calling the function in your program Using if statements (can combine them with dictionaries) Instructions For every plant, there is a growth cycle. The number of days that it takes starting from being a seed and ending in being a fruit is what is called the growth cycle. Write a function that takes a plant's name as an argument and…
- A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. For example, 19 yields 3 fives and 4 ones. Write a single statement that assigns the number of one dollar bills to variable numOnes, given amountToChange. Hint: Use the % operator. #include <stdio.h> int main(void) { int amountToChange; int numFives; int numOnes; scanf("%d", &amountToChange); numFives = amountToChange / 5; /* Your solution goes here */ printf("numFives: %d\n", numFives); printf("numOnes: %d\n", numOnes); return 0;Java Program ASAP ************This program must work in hypergrade and pass all the test cases.********** The program down below does not work in Hypergrade and does not pass the test cases. For Test Case 1 first print out Please enter the file name or type QUIT to exit:\ then you type text1.txtENTER and it displays Stop And Smell The Roses./n there needs to be nothing after that. For test case 2 first print out Please enter the file name or type QUIT to exit: then you type txt1.txtENTER then it reads out File 'txt1.txt' is not found.\n Then it didplays Please re-enter the file name or type QUIT to exit:\n after the test file is not found. then you type in text1.txt and it displays stop and smell the roses.\n. For test case 3 first print out Please enter the file name or type QUIT to exit: then you type text2.txtENTER and it displays A true rebel you are! Everyone was impressed. You'll do well to continue in the same spirit.\nPlease explain a bit more in the way of…C++ code A simple version of snakes and ladderImplement a game that initially asks how many players will play the game. The game will then ask the name of each player. The game is played as follows:1. The game is played iteratively. In every iteration, every player takes turn to roll a dice. The face value of dice is added to the total score of the player.2. The first player to reach 100 score gets 1st position. The second player to reach 100 score gets 2nd position.3. When a player reaches 100, he no longer remains part of the play. If current score + face value is greater than 100, then the player will retry in the next iteration, i.e., the score must exactly become 100.4. There are ladders at 20 and 60. If a player’s score becomes exactly 20, the score becomes 40. If a player’s score is exactly 60, the score becomes 75. Similarly, there are snakes at 50 and 90. If a player’s score is exactly 50, the score become 40. If a player’s score is exactly 90, the score becomes 79.5. When n-1…
- The Body Mass Index – BMI is a parameter used to measure the health status of an individual. Various BMI values depict how healthy or otherwise a person is. Mathematically BMI = weight ÷hight×hight Write a java program using either JOptionPane or Scanner to collect the following values of an individual: i. Name ii. Weight iii. Height Major Topic Getting user inputs B.) Compute the BMI of that individual Make the following decisions if: i. BMI < 18.5 is under weight ii. BMI >=18.5 but =25 but = 30 but = 40 Morbid Obesity d)Display the results of the individualUSE JAVA LANGUAGE Create a constructor named Exam that assigns "Good luck" to a previously declared String variable named message. Create an empty overloaded constructor for the Exam class with two (2) String parameters named period and level. Declare a double-type accessor named getPrice that returns the value of price. Declare a boolean-type accessor named isFinished that returns the value of status. Declare a class named Midterm that inherits from the class named Exam. Create three (3) class declarations to show multiple levels of inheritance. Use the classes named Exam, Midterm, and Essay. Create a constructor named Midterm that prints "Exam has started." using println(). Its first statement should be a call to a constructor in the parent class. Given the base class named Quiz and the derived class named Essay, write a statement to show inheritance between these classes.Change value of isMomHappy to true and run the code. Provide your source code and the output var isMomHappy = false; //promise var willIGetNewPhone = new Promise( function (resolve, reject) { if(isMomHappy){ var phone = { brand: 'samsung', color:'black' }; resolve(phone); } else { var reason = new Error('mom is not happy'); reject(reason); } } ); //call our promise var askMom = function() { willIGetNewPhone .then(function (fulfilled){ //yay, you got a new phone console.log(fulfilled); //output: {brand: 'sumsung', color: 'black' } }) .catch(function (error) { //oops, mom didnt buy it console.log(error.message); //output: 'mom is not happy' }); }; askMom();