adjust your program from exercise 2 so that only lower case letters are allowed for valid passwords.

Answers

Answer 1

To adjust your program from exercise 2 so that only lower case letters are allowed for valid passwords, check the code given below.

What is program?

A programme is a set of instructions that a computer uses to carry out a particular task. A programme is like the instructions for a computer, to use an analogy. It includes a list of components (called variables, which can stand for text, images, or numeric data) and a list of instructions (called statements), which instruct the computer how to carry out a particular task.

Specific programming languages like C++, Python, and Ruby are used to create programmes. These high level programming languages are writable and human-readable. Compilers, interpreters, and assemblers inside the computer system then translate these languages into low level machine languages.

//CODE//

/*Exercise 2: Adjust your program from Exercise 1 so that only

lower case letters are allowed for valid passwords.*/

#include <iostream>

#include <string>

#include <cctype>

#include <cstring>

using namespace std;

//function prototypes

bool testPassWord(char[]);

int countLetters(char*);

int countDigits(char*);

bool islowerCase(char *strPtr);

int main()

{

char passWord[20];

cout << "Enter a password consisting of exactly 4 letters in lower case letters and 6 digits:";

cin.getline(passWord,20);

if (testPassWord(passWord))

cout << "Please wait - your password is being verified" << endl;

else

{

 cout << "Please enter a password with exactly  4 letters in lower case letters and 6 digits" << endl;

 cout << "For example, my1237Ru99 is valid" << endl;

}

// Fill in the code that will call countLetters and countDigits and will

//print to the screen both the number of

// letters and digits contained in the password.

cout << "There are " << countLetters(passWord) << " letters in the password.\n";

cout << "There are " << countDigits(passWord) << " digits in the password.\n";

if(countLetters(passWord)==4 && countDigits(passWord)==6)

{

cout<<"password: "<<passWord<<" is valid"<<endl;

}

else

cout<<"So, password: "<<passWord<<" is INVALID"<<endl;

//Pause the system for a while

system("PAUSE");

return 0;

}

//**************************************************************

// testPassWord

//

// task: determines if the word in the character array passed to it, contains //exactly 5 letters and 3 digits.

// data in: a word contained in a character array

// data returned: true if the word contains 5 letters & 3

// digits, false otherwise

//

//**************************************************************

bool testPassWord(char custPass[])

{

int numLetters, numDigits, length;

length = strlen(custPass);

if(!islowerCase(custPass))

{

 cout<<"Lower case letters are only allowed for valid password.";

}

numLetters = countLetters(custPass);

numDigits = countDigits(custPass);

//Check valid password consists of 10 characters,6 of which must be digits

//and the other 4 letters

if (numLetters == 4 && numDigits == 6 && length == 10 )

 return true;

else

 return false;

}

//**************************************************************

// countLetters

//

// task: counts the number of letters (both

// capital and lower case)in the string

// data in: a string

// data returned: the number of letters in the string

//

//**************************************************************

int countLetters(char *strPtr)

{

int occurs = 0;

while(*strPtr != '\0')

{

 if (isalpha(*strPtr))

 occurs++;

strPtr++;

}

return occurs;

}

bool islowerCase(char *strPtr)

{

int occurs = 0;

while(*strPtr != '\0')

{

 if (islower(*strPtr))

 occurs++;

strPtr++;

}

if(occurs==4)

return true;

else

 return false;

}

//**************************************************************

// countDigits

//

// task: counts the number of digits in the string

// data in: a string

// data returned: the number of digits in the string

//

//**************************************************************

int countDigits(char *strPtr)

{

int occurs = 0;

while(*strPtr != '\0')

{

if (isdigit(*strPtr)) // isdigit determines if the character is a digit

occurs++;

strPtr++;

}

return occurs;

}

Learn more about program

https://brainly.com/question/26497128

#SPJ4


Related Questions

A check dishonored by a bank because of insufficient funds in the account of the maker of the check is called a/an ________.
a. non-sufficient funds check
b. dishonored check
c. canceled check

Answers

Answer:
Correct option is A.
Non-Sufficient funds check

import java.util.Scanner; public class PickupWindow { public static void main(String[] args) { // create scanner object Scanner input = new Scanner(System.in); // Display menu String menu = "1. Hamburger\n2. Cheeseburger\n3. Veggie Burger\n4. Nachos\n5. Hot Dog\n"; System.out.println(menu); // Get customer order System.out.println("Enter label: "); String customerOrder = input.nextLine(); // Use substring to get the first character (the number) String combo = // Create Integer object by using the static // method Integer.valueOf(someString) // to turn the string into an Integer Integer.valueOf(comboNumber); Integer comboNumber = 5; // Print out what the customer ordered System.out.println("Customer ordered number "+ comboNumber); } }

Answers

The code using Java for menu.

What is Java?

Java is a class-based, object-oriented, general-purpose programming language made to have fewer implementation dependencies. It is a computing platform for developing applications. As a result, Java is fast, safe, and dependable. In laptops, data centers, game consoles, scientific supercomputers, mobile phones, and other devices, it is frequently utilized for the development of Java applications.

The Java Platform is a set of programs that make it easier for programmers to create and run Java applications effectively. It has a compiler, an execution engine, and a collection of libraries. It consists of software and specifications for computers.

Given to import java, Scanner; public class

The code is

step by step explanation,

import java.util.Scanner;

public class PickupWindow

{

 public static void main(String[] args)

 {

   // create scanner object

  Scanner input = new Scanner(System.in)

   // Display menu

   String menu = "1. Hamburgern2. Cheeseburgern3. Veggie Burgern4. Nachosn5. Hot Dog\n";

   System.out.println(menu);

   // Get customer order

   System.out.println("Enter label: ");

   String customerOrder = input.nextLine();

  // Use substring to get the first character (the number)

 String combo =

 // Create  Integer object by using the static

   // method Integer.valueOf(someString)

  // to turn the string into an Integer

   Integer.valueOf(comboNumber);

   Integer comboNumber = 5;

   // Print out what the customer ordered

   System.out.println("Customer ordered number "+ comboNumber);

 }

}

Here // sentences are not part of coding, they are just to explain the next step or to give information about what the code shows.

Hence, the code is described.

Learn more about Java;

https://brainly.com/question/29897053

#SPJ4

QUESTION 1In which object can you rename a field?a. tableb. formc. macrod. report3 pointsQUESTION 2Tables, queries, and forms are examples of Access ____.a. objectsb. valuesc. fieldsd. controls3 pointsQUESTION 3When can you rename a table?a. when you open the table in Design viewb. when you open the table in Datasheet viewc. immediately after you open the tabled. after you close the table3 pointsQUESTION 4Which of the following templates lets you create a database from scratch?a. Application databaseb. Blank desktop databasec. Personal databased. Custom desktop database3 pointsQUESTION 5A category of data such as a customer's name, city, state, or phone number is called a _____.a. fieldb. tablec. data typed. record3 pointsQUESTION 6_____ view provides the most options for defining fields.a. Field Createb. Field Definec. Table Created. Table Design3 pointsQUESTION 7Which of the following is the fastest way to open an Access database?a. Start Access from the Start menu.b. Double-click the database icon.c. Right-click the database icon.d. Start Access, and then create a new database.3 pointsQUESTION 8What are you saving when you click the Save button to save a table object?a. the table designb. the entire databasec. the field values in the tabled. the records in the table3 pointsQUESTION 9To back up a database, you use the _____ command.a. Back Up Databaseb. Compact & Repairc. Make a Backupd. Package and Sign3 pointsQUESTION 10Which data type stores only one of two values?a. Date/Timeb. Yes/Noc. Hyperlinkd. AutoNumber

Answers

The object that you can you rename a field is A. table

Tables, queries, and forms are examples of Access .a. objects

The templates lets you create a database from scratch is D. Custom desktop database

What is a database?

A database is a collection of data that has been organized to make it simple to manage and update. Data records or files containing information, such as sales transactions, customer information, financial data, and product information, are typically aggregated and stored in computer databases.

A database is a planned gathering of data. They enable the manipulation and storage of data electronically. Data management is made simple by databases. Let's use a database as an example. Foe example, it is used by an online phone book to store information about people, their phone numbers, and other contact information.

To rename a table:

Click on the table.

Go to Table Tools > Design > Properties > Table Name.

Learn more about database on:

https://brainly.com/question/518894

#SPJ1

A legacy system is all of the following EXCEPT:Usually found on a mainframe.A system that is already in place, from the past.A system that often holds the middle tier of a multiple-tier system.Old systems that often require hard-to-use command languages.Systems that most often have detailed information that can be accessed by a system at a higher tier.All of the following relate to securing assets EXCEPT:Access to networksAccess to end-user devicesHow third-party vendors ensure securityThe ease with which the system runs after a failure is correctedAccess to servers

Answers

A legacy system is all of the following except a system that often holds the middle tier of a multiple-tier system. The correct option is c.

What is a legacy system?

Any outdated computing system, hardware, or software that is still in use is considered a legacy system. Computer hardware, software programs, file formats, and programming languages are all examples of legacy systems.

It refers to software or IT systems that have been around for a long time but should be replaced by a more recent one due to technical advances.

Therefore, the correct option is c, A system that often holds the middle tier of a multiple-tier system.

To learn more about the legacy system, refer to the link:

https://brainly.com/question/29468465

#SPJ1

A network ________ is a set of rules for how information and communications are exchanged.
A) protocol
B) token
C) frame
D) packet

Answers

The answer is protocol.

How is symmetry related to rigid transformations?

Answers

Answer: (read explanation)

Explanation:

Symmetry and rigid transformations are related in that symmetry is a type of rigid transformation. A rigid transformation is a type of transformation in geometry in which the shape of an object is preserved after the transformation is applied. This means that the distances between all points on the object remain the same, and the angles between those points are also unchanged.

Symmetry is a specific type of rigid transformation that involves a reflection, rotation, or translation of an object such that the resulting image is congruent to the original. In other words, symmetry is a type of transformation in which an object is mapped onto itself in a way that preserves its shape and size.

For example, if an object has rotational symmetry, it means that it can be rotated by a certain angle and the resulting image will be congruent to the original. If an object has reflectional symmetry, it means that it can be reflected across a certain line and the resulting image will be congruent to the original.

Overall, symmetry is a type of rigid transformation in which an object is mapped onto itself in a way that preserves its shape and size. This type of transformation is related to other types of rigid transformations, such as rotations and translations, which also preserve the shape and size of an object.

Write an algorithm using pseudocode for peeling an apple. What does that look like?

Answers

An  algorithm using pseudocode for peeling an apple is given below

1. Rinse the apple under running water to remove any dirt or debris.

2. Cut off the top and bottom of the apple using a sharp knife.

3. Starting at the top of the apple, use the knife to carefully slice off the skin in a circular motion, following the contour of the apple.

4. Continue peeling the skin off the apple until the entire apple is peeled.

5. Discard the skin and slice or chop the peeled apple as desired.

What are the ways to write a pseudocode?

Another way or example used of the algorithm via the use a more structured pseudocode format:

procedure peelApple(apple: Apple)

  input: an apple

  output: a peeled apple

 

  1. Rinse the apple under running water to remove any dirt or debris.

  2. Cut off the top and bottom of the apple using a sharp knife.

  3. Initialize a variable "peeled" to be an empty list.

  4. While the apple is not fully peeled, do the following:

     a. Starting at the top of the apple, use the knife to carefully slice off a strip of skin.

     b. Add the strip of skin to the "peeled" list.

  5. Return the peeled apple.

end procedure

Learn more about pseudocode from

https://brainly.com/question/24953880

#SPJ1

if the maximum load capacity (or buckling load) of column 1 (fixed-fixed) is 100 kn, the load capacity (or buckling load) of column 2 (fixed-free) will be equal to:

Answers

if the maximum load capacity (or buckling load) of column 1 (fixed-fixed) is 100 kn, the load capacity (or buckling load) of column 2 (fixed-free) will be = 1.56kN.

What is buckling load?

Buckling is simply the out-of-plane bending of a vertical compression member. The slenderness of the vertical compression member is typically to blame. This phenomenon is clearly explained by Euler, who has provided elaborate formulas to determine the actual amount of buckling in the compression member.

The compression member may be a column (long, short, or medium), a built-up steel member with a slender web, a readily available steel member with a slender web, etc. For various support situations, different buckling conditions exist. The terms "buckling load" and "crushing load" are interchangeable. We must fortify the slender member to prevent buckling.

Learn more about Buckling

https://brainly.com/question/14338077

#SPJ4

Which of the following is most closely associated with
hairlike receptors in the semicircular canals?
a. Body position
E b. Smell
non
c. Hearing
d. Pain

Answers

The gelatinous membrane that stretches across the tube to form a fluid-tight seal akin to the skin of an ear drum covers the semicircular canal receptor cells, also known as hair cells, only in the center of the circular tubes in a special epithelium.

You can sense your body's position and keep your balance thanks to the stimulation of hair-like receptors that send signals to the cerebellum at the back of the brain.

What functions do semicircular canals perform?

Your inner ear contains three tiny, liquid-filled tubes called semicircular canals that aid in balance. The fluid in the semicircular canals sloshes around as your head moves, moving the fine hairs that line each canal.

To know more about semicircular canals visit:-

brainly.com/question/15873430

#SPJ4

PROBLEM
Knowing that the tension in rope
AC is F(N), determine the
resultant of the three forces
exerted at point C of post BC.
1100 mm
L=1460 mm
960 mm
B
C
25
24
3
5
4
500 N
200 N

Answers

The resultant of the three forces exerted at point C of post-BC is 475.36 N.

What is the resultant force?

The difference between the forces that are acting on an object as part of a system is known as the resultant force. For instance, a resultant force of 7N to the right is produced by a 3N force to the left and a 10N force to the right.

Given, the tension in the rope in the figure.

L=1460 mm

BC = 25

Net force at C = 480i +140j +(160i -120j) +(-240i-275j) = 400i-255j = 475.36

N 32.51 degrees south of east.

Therefore, the resultant of the three forces is 475.36 N.

To learn more about resultant force, refer to the link:

https://brainly.com/question/16380983

#SPJ1

Screen locks are a form of endpoint device security control. O True O False

Answers

Answer:

HOPE THIS HELPS.

Explanation:

A. true. Screen locks are a form of endpoint device security control.

Screen locks are a form of endpoint device security control.

The statement is true .

Given,

Screen locks are a form of endpoint device security control .

Here,

Screen locks are a form of endpoint device security control. When you set a screen lock on your device, it requires a passcode, pattern, fingerprint, or other authentication method to unlock and access the device.

This helps protect the device and the data stored on it from unauthorized access in case it is lost or stolen.

Thus the statement is true.

Know more about screen lock,

https://brainly.com/question/32730037

#SPJ6

Cumulative algorithm can only be used with primitive data types O True O False

Answers

Cumulative algorithm can only be used with primitive data types is False.

What is Cumulative algorithm?

A cumulative algorithm is a type of algorithm that processes a sequence of items and produces a single result by performing some operation on each item in the sequence and carrying forward the result of that operation to the next item.

Therefore, This type of algorithm can be used with primitive data types, such as integers and floating point numbers, but it can also be used with more complex data types, such as arrays, structures, and objects.

Learn more about algorithm  from

https://brainly.com/question/21328677

#SPJ1

A tank is constructed of a series of cylinders having diameters of 0.30, 0.25, and 0.15 m as shown in the figure. The tank contains ethanol, oil and water. Ethanol is exposed to air. A mercury manometer is attached to the bottom. Determine the manometer reading, h

Answers

The mercury manometer that attached to the bottom will reading 2.7 cm.

How to determine the manometer reading?

[tex]p_1[/tex] = ethanol density = 789 kg/m^3

[tex]p_2[/tex] = oil density = 918 kg/m^3

[tex]p_3[/tex] = water density = 1000 kg/m^3

[tex]p_4[/tex] = mercury density = 13600 kg/m^3

Since the ethanol is exposed to air and the manometer also exposed to air, we can determine the height of mercury is equal by extra pressure by liquid. So,

[tex]p_4[/tex]*g*h = [tex]p_1[/tex]*g*0.1+[tex]p_2[/tex]*g*0.1+[tex]p_3[/tex]*g*0.2

we can eliminate the g or gravity.

13600h = 789*0.1+918*0.1+1000*0.2

13600h = 78.9+91.8+200

13600h = 370.7

h = 0.027 m

h = 2.7 cm

Thus, the mercury manometer reading will be 2.7 cm.

You question is incomplete, but most probably your full question was

A tank is constructed of a series of cylinders having diameters of 0.30, 0.25, and 0.15 m as shown in the figure. The tank contains ethanol, oil and water. Ethanol is exposed to air. A mercury manometer is attached to the bottom. Determine the manometer reading, h

(image attached)

Learn more about mercury manometer here:

brainly.com/question/13898695

#SPJ4

what two different dimm technologies below can be used in a quad channel configuration? (select two.)

Answers

The correct answer is DDR4 -DDR3 two different dimm technologies below can be used in a quad channel configuration.

A DIMM is a module that has one or more RAM chips mounted on a tiny circuit board with connections that link it to the motherboard of the computer. Each data bit is kept in a distinct memory cell by the DIMM. Since personal computer processors have a 64-bit data width, DIMMs employ a 64-bit data route. Physically, PCIe slots can be configured as x1, x4, x8, or x16. The vast majority of GPUs require PCIe x16 to function at their peak performance, making it the most often used configuration. A PCIe slot has two parts: mechanical (cards) and electrical (lanes).

To learn more about DDR4 -DDR3 click the link below:

brainly.com/question/15068247

#SPJ4

Answer: DDR3 & DDR4

Explanation:

public class NumberTriangle { public static void main(String[] args) { // Call makeNumberTriangle makeNumberTriangle(); } // Makes an upright triangle with the numbers 1-5 public static void makeNumberTriangle() { // Your code goes here! } }

Answers

For programming an upright number triangle we will need to use a while loop.

What is a while loop?

When a condition is not satisfied, a "While" loop is used to repeat a certain piece of code an undetermined number of times. For instance, if we want to ask a user for a number between 1 and 10, but we don't know how often they might enter a greater number, we keep asking "while the value is not between 1 and 10."

import java.io.*;

class GFG {

   public static void main(String[] args)

   {

       int r = 1, c = 1, n = 5;

       // the while loop checks the conditions until the

       // condition is false. if it is true then enter it in

       // to loop and execute the statements

       while (r <= n) {

           while (c <= r ) {

               // printing the required pattern

               System.out.print(c+" ");

               c++;

           }

           r++;

           c = 1;

           // new line after each row

           System.out.println();

       }

   }

}

Learn more about while loop here:

https://brainly.com/question/15690925

#SPJ4

. A wastewater containing 50 mg/L of phenol was subjected to an equilibrium
test to determine the constant in the Langmuir isotherm. One-liter samples
were dosed with powdered activated carbon (PAC) in four jars, and when
equilibrium was reached the equilibrium concentrations of phenol were
analyzed.
a) From the results shown below, determine the Langmuir isotherm’s
constants.
b) If the wastewater with a flow rate of 0.10 m3/s containing 50 mg/L of
phenol is to be treated using PAC to produce an effluent concentration
of 0.10 mg/L, calculate the quantity of PAC needed for the operation?

Answers

Answer:

Step 1: Determine the constants a and b in the Langmuir Equation.

a = 6.0 g/L

b = 1.783 g/L

Step 2: Calculate the dosage required to yield an effluent with a phenol concentration of 0.10 mg/L.

dosage = (2 * 6.0) + (1 * 1.783) = 11.83 g

Explanation:

a(n) ____-type headlight system features a mechanical shield plate or shutter that is moved up and down as the headlights are switched between low and high beams.

Answers

A bi-xenon type headlight system features a mechanical shield plate or shutter that is moved up & down as the headlights are switched between low and high beams.

What is headlight?

A headlight is a lamp that is mounted on the front of a car to illuminate the road in front of it. Although headlights and headlamps are frequently used interchangeably, in the most formal sense, headlight refers to the device itself and headlight to the light beam that is generated and dispersed by the device.

Since the invention of the automobile, headlight performance has steadily increased, driven by the stark difference between daytime and nighttime traffic fatalities: according to the US National Highway Traffic Safety Administration, despite only 25% of traffic travelling at night, nearly half of all traffic-related fatalities take place during the day.

Learn more about headlight

https://brainly.com/question/14836887

#SPJ4

An algorithm can fall into an infinite loop when ____. the input operations were missing the algorithm uses more than one loop the output operations were missing the continuation condition of the loop never becomes false

Answers

An algorithm can fall into an infinite loop when the continuation condition of the loop never becomes false.

What is loop?

Loop is a set of code or instruction in most programming language to iterate or repeatedly execute the code in loop body without written it multiply times.

There are different method to call the loop, but the basic rule of the loop is still same which is the loop will continuously execute the code as long as condition is true.

Thus, until the condition in loop becomes false, the loop still running into infinite loop.

Learn more about loop here:

brainly.com/question/26098908

#SPJ4

develop a function {maptuple t f} that returns a tuple that has the same width and label as the tuple t with its fields mapped by the function f. for example, local fun {sq x} x*x end in {maptuple a(1 2 3) sq} end should return a(1 4 9). hint: a tuple is constructed with {maketuple l n}, where l is the label and n is the width of the tuple.

Answers

Develop a function {maptuple t f} that returns a tuple that has the same width and label as the tuple t with its fields mapped by the function f.
fun {maptuple t f}

 let l = {tupLabel t}

 let n = {tupWidth t}

 let lf = List.map f l

 maketuple lf n

end

What is function?
Function
is a block of code that performs a specific task. It is a sequence of statements that are written for a particular purpose and can be called upon when needed. Functions allow for code to be reused, making it easier to debug and maintain programs. They also help to reduce the amount of code needed in a program by allowing for code to be broken down into smaller, more manageable pieces. Functions can take parameters, which are pieces of data that are passed to the function when it is called. By passing parameters, the same function can be used with different data, making it more versatile. Functions can also return values, which are pieces of data that are sent back to the program once the function has completed its task. Functions can be written in any programming language, and are an important part of programming.

To learn more about function
https://brainly.com/question/29757837
#SPJ4

write the code to declare and initialize a one-dimensional array of 10 items. each element is assigned a random integer within a range based on its index. example: For index 0, assign a random integer from 0 to 99, inclusive For index 1, assign a random integer from 100 to 199, inclusive For index 2, assign a random integer from 200 to 299, inclusive (and so on...)

Answers

To write the code to declare and initialize a one-dimensional array of 10 items. each element is assigned a random integer within a range based on its index, check the code given below.

What is one-dimensional array?

A type of data structure called an array is used in computer science to store identical data type elements in continuous memory locations. In a single variable, an array enables us to store multiple values of the same type.

The values can be kept in a variety of structures thanks to different types of arrays. The one-dimensional array structure is one of the types of arrays where values are stored that are used the most frequently. 

One of Array's most straightforward forms is this one. Both their definition and application in programmes are very simple. It is simple to initialise and modify the values kept in a one-dimensional array.

//CODE//

import java.util.Random;

 public class RandomArray {

     public static void main(String[] args) {

        int[] arr = new int[10];

        Random random = new Random();

        for(int i = 0; i < arr.length; ++i) {

            arr[i] = i*100 + random.nextInt(100);

        }

        // print array

        for(int i = 0; i < arr.length; ++i) {

            System.out.println(arr[i]);

        }

    }

 }

Learn more about one-dimensional array

https://brainly.com/question/28505614

#SPJ4

Choose the attribute used to provide accessibility by configuring a text alternative that is available to browsers and other user agents that do not support graphics?

Answers

The attribute used to provide accessibility by configuring a text alternative for graphics is the "alt" attribute. This attribute allows users to specify a text description of the image, which can be displayed in place of the image if the user's browser or other user agent does not support graphics. This can make the content of the website more accessible to users with visual impairments or other disabilities.

FILL IN THE BLANK parts manufactured by the same company that built the vehicle or the company that supplied the parts to the manufacturer of the vehicle are called____parts.

Answers

Parts manufactured by the same company that built the vehicle or the company that supplied the parts to the manufacturer of the vehicle are called OME [original equipment manufacturer] parts.

What distinguishes a manufacturer from an OEM?Original Equipment Manufacturer is referred to as OEM. The majority of the time, OEMs buy components from other producers or suppliers and use them to put their final products together. OEMs provide components and subassemblies that are supplied to other businesses for them to assemble into their own final goods.Original equipment manufacturer is referred to as OEM. This refers to a business that manufactures an item to be sold by another firm under its own name. For instance, an OEM computer maker may produce PCs for a company with the brand name Dell or Lenovo, who would then market the devices under their own brands.

To learn more about OME refer to:

https://brainly.com/question/14958608

#SPJ4

Traditional database application programs are written in object-oriented languages like ________.
A) Datalog
B) Visual Basic
C) Unigraphics
D) Pascal

Answers

Answer:
Correct option is Visual Base
Option B

bsquare(k) takes k as a parameter and returns a list containing all perfect squares less than k. (not including k). bsquare(5) will return the list [1, 4] print that list

Answers

A program where bsquare(k) takes k as a parameter and returns a list containing all perfect squares less than k (not including k) is given below in the code.

What is parameter?

A parameter, in general, is any feature that helps define or categorize a particular system (meaning an event, project, object, situation, etc.). To put it another way, a parameter is a system component that is essential or helpful for identifying the system or evaluating its functionality, status, or other properties.

The term "parameter" has more specific meanings in some disciplines, including mathematics, computer programming, engineering, statistics, logic, linguistics, and electronic music composition.

It has broader meanings in addition to its technical applications, especially when used in non-scientific contexts. Examples of defining characteristics or boundaries are "test parameters" and "game play parameters."

//CODE//

def ASquare(k):

    lst = []

    for i in range(k):

        lst.append((i + 1) ** 2)

    return lst   print(ASquare(5))

  def BSquare(k):

    lst = []

    i = 1

    while i * i < k:

        lst.append(i * i)

        i += 1

    return lst

  print(BSquare(5))

Learn more about parameter

https://brainly.com/question/13794992

#SPJ4

Please Answer Thank You!

Answers

A free body diagram is a straightforward drawing that depicts the forces operating on the elements of a physical system.

How do you calculate tension in Hooke's Law?By applying the formula Fs=-Kx (where k is the spring constant and x is extension), tension can be calculated using Hooke's equation. The spring system uses this.Any physical object that is in contact with another one can apply forces to that object. Depending on the types of objects in touch, we label these contact forces differently. If a rope, string, chain, or cable is one of the objects exerting the force, the force is referred to as tension.The tension is determined using the formula T = (Tx2 + Ty2)1/2. The component TX generates the centripetal force, hence TX = mv2 (m is the object's mass; v is its velocity).  TY = mg (m = mass of the object; g = acceleration due to gravity), where mg is the object's weight.

To learn more about  tension refer,

https://brainly.com/question/16688357

#SPJ1

2. create another class cell phone list to store cellphone objects in an arraylist. this class can be used to serialize cellphones into an xml file.(see account records.java)

Answers

To create another class cellphonelist to store cellphone objects in an arraylist. this class can be used to serialize cellphones into an xml file, check the given java code below.

What is java?

Java is a computer platform and programming language that Sun Microsystems first released in 1995. Through the provision of the dependable platform upon which numerous services and applications are built.

It has grown from modest beginnings to power a significant portion of the digital world of today. Java is still a crucial component of cutting-edge products and future-oriented digital services.

//JAVA CODE//

import org.w3c.dom.Document;

import org.w3c.dom.Element;

import javax.xml.parsers.DocumentBuilder;

import javax.xml.parsers.DocumentBuilderFactory;

import javax.xml.parsers.ParserConfigurationException;

import javax.xml.transform.Transformer;

import javax.xml.transform.TransformerException;

import javax.xml.transform.TransformerFactory;

import javax.xml.transform.dom.DOMSource;

import javax.xml.transform.stream.StreamResult;

import java.io.File; import java.util.List;

 public class CellPhoneList {

     List<CellPhone> cellPhoneList;

    String model,manufacturer;

    double retailPrice;

     public CellPhoneList(List<CellPhone> cellPhoneList, String model, String manufacturer, double retailPrice) {

        this.cellPhoneList = cellPhoneList;

        this.model = model;

        this.manufacturer = manufacturer;

        this.retailPrice = retailPrice;

        xmlWrite(model,manufacturer, String.valueOf(retailPrice));

    }

      private static void xmlWrite(String a,String b,String c){

         try {

             DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();

            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();

            Document doc = docBuilder.newDocument();

             org.w3c.dom.Element rootElement =  doc.createElement("CELLPHONE");

            doc.appendChild(rootElement);

            //org.w3c.dom.Element browser = doc.createElement("BROWSER");

            // browser.appendChild(doc.createTextNode("chrome"));

            //rootElement.appendChild(browser);

             org.w3c.dom.Element base = doc.createElement("BASE");

            base.appendChild(doc.createTextNode("http:fut"));

            rootElement.appendChild(base);

            /*org.w3c.dom.Element group = doc.createElement("GROUP");

            rootElement.appendChild(group);*/

            org.w3c.dom.Element model = doc.createElement("MODEL");

            model.appendChild(doc.createTextNode(String.valueOf(a)));

            base.appendChild(model);

             Element manufacture = doc.createElement("MANUFACTURE");

            manufacture.appendChild(doc.createTextNode(String.valueOf(b)));

            base.appendChild(manufacture);

             Element rate = doc.createElement("RETAIL");

            rate.appendChild(doc.createTextNode(String.valueOf(c)));

            base.appendChild(rate);

             TransformerFactory transformerFactory = TransformerFactory.newInstance();

            Transformer transformer = transformerFactory.newTransformer();

            DOMSource source = new DOMSource(doc);

            StreamResult result = new StreamResult(new File("cellphone.xml"));

            transformer.transform(source, result);

            System.out.println("File saved!");

        }

catch (ParserConfigurationException | TransformerException pce) {

            pce.printStackTrace();

        }

     }

}

Learn more about Java

https://brainly.com/question/26642771

#SPJ4

architects must consider the availability and cost of when they plan their projects. question 1 options: bribes breathing apparatus building materials fresh water none of the other answers

Answers

Architects must consider the availability and cost of building materials when they plan their projects.

Who are architects?

Building planning and design are the expertise of an architect, who typically has a significant impact on how a building is built. The art and science of building design are fields in which architects have extensive training. Architects need to be licenced professionally because they are in charge of ensuring the security of the people who use their buildings.

The Greek term for "chief builder" is the origin of the word "architect." Between the craftsman who designed a building and the one who actually built it, there was no distinction for a large portion of history.

Buildings could then be planned much more thoroughly before being built thanks to the development of linear perspective drawing in the 1500s, which made it possible to accurately depict three-dimensional structures in two dimensions.

Learn more about architect

https://brainly.com/question/7472215

#SPJ4

Determine (a) the principal stresses and (b) the maximum in-plane shear stress and average normal stress at the point. Specify the orientation of the element in each case.

Answers

To determine the principal stresses and the maximum in-plane shear stress and average normal stress at a point in a structural element, you will need to know the following information:

The element's material characteristics will affect how it responds to applied loads.

The geometry of the element will determine its size and shape, which will have an impact on how it distributes loads.

The loads put on: The stresses that arise in the element will be determined by this.

The point in question's location is: This will reveal the strains that are being placed on the spot.

With this knowledge, you may use the procedures that follow to identify the main stresses, the maximum in-plane shear stress, and the average normal stress at the point:

Find the strain-displacement relationship for the element: You will then be able to compare the applied loads to the resulting strains in the element.

Find the stress-strain relationship for the element: You will be able to connect the strains to the stresses that were created in the element as a result.

Find out what stresses are at work on the point: The stresses acting on the point can be calculated using the strain-displacement and stress-strain relationships of the element, the applied loads, and the geometry of the element.

To know more about Principal stresses kindly visit
https://brainly.com/question/14418799

#SPJ4

A ________ is a program module whose purpose is to test other modules by calling them.
A) stub
B) driver
C) main function
D) dummy program
E) pseudocode routine

Answers

Answer:

A) Stub.

Explanation:

A stub is a program module whose purpose is to test other modules by calling them.

Consider the relation R, which has attributes that hold schedules of course and sections at a university: R = {Course_no, Sec_no, Offering_dept, Credit_hours, Course_level, Instructor_ssn, Semester, Year, Days_hours, Room_no, No_of_students}. Suppose that the following functional dependencies hold on R. {Course_no} rightarrow {Offering_dept, Credit_hours, Course_level} {Course_no, Sec_no, Semester, Year} rightarrow {Days_house, Room_no, No_of_students, Instructor_ssn} {Room_no, Days_hours, Semester, Year} rightarrow {Instructor_ssn, Course_no, Sec_no} Try to determine which sets of attributes from keys of R, How would you normalized this relation?

Answers

The sets of attributes {Course_no, Sec_no, Semester, Year} and {Room_no, Days_hours, Semester, Year} are both keys of R. This relation can be normalized by dividing it into two separate relations, R1 and R2.

What is attributes?
The traits or features that characterise someone or something are known as their attributes. They are employed to specify the features and traits of a person, location, thing, or idea. Bodily, physical, emotional, or religious attributes are all possible. Physical characteristics include things like height, weight, eye colour, gender, and skin tone. Intelligence, creativity, and issue abilities are examples of mental qualities. Empathy, self-control, and compassion are examples of emotional qualities. Faith, patience, & humility are spiritual qualities. In order to comprehend and recognise the distinctive characteristics of a person, area, item, or idea, attributes are crucial.

R1 equals the following: "Course no, Offering dept, Credit hours, Course level"

R2 is equal to "Course no, Sec no, Semester no, Year, Days hours, Room no, Number of Students, Instructor ssn"
R1 would have details on the courses the university provided, and R2 would contain details about the parts of those courses. By doing so, any data duplication would be removed, and data maintenance would be simpler.


To learn more about attibutes
https://brainly.com/question/1997724
#SPJ4

Other Questions
how does a liver cell respond to insulin 2 SEQUENCING Identify the events in the expansion of the Persian Empire after Cyrus. Write the events in the organizer according to the historical sequence. please help me on history.... please 4 x 1/3 as a fraction The owner of the Texans football team wants to paint their red, white, and blue logo on the side of a building at their training facility. However, the existing paint, which would comprise the background for the logo, is beginning to deteriorate. The owner is considering re-painting the building with a special weatherproof paint prior to adding the logo. If the special background paint costs $1.25 per square foot, how much money will the owner have to spend on the paint for the background Select All The expressions that represent the total area of the rectangle Please select the word from the list that best fits the definitionCatholic clergy and church officials- Declaration of Rights of man and the citizen- urbanization - lassez - faire- Manifest Destiny - First Estate- abolitionism - Edmund Cartwright - Giuseppe Garibaldi- Romanticism - Industrialism Links, wrong answers, or "free point" answers will not be tolerated thank you and have a great day! :) how natural selection contributes to the evolution of a species Find the area of the trapezoid Lots of molds Lily's father really liked the mug and thought that others would like it too. He asked Lily if he wanted to try to manufacture and sell them. To make many cups, they would have to find a factory. The factory would need a mold so that all the cups were exactly the same shape. And to make the mold, they needed a perfect cup. Working in clay, Lily tried to find the best possible shape. She tried thinner legs (too unstable), thicker legs (too strong grip), and even a fourth leg (too unstable). She folded the edge so the drinks didn't splatter. Finally, she thought she had a nice cup. What is this part of the passage mostly about ? Lily worked with her father de ella to make many mugs with the same shape. Lily needed to find a big factory that would make her mug from her. Lily got the idea from her father de ella to sell a lot of different mugs. Lily tried many different ways to make the best mug for the factory mold. Eaterfication experiment Please help marking brainliest if it's correct and just Explain Christie's Auction sold a painting for$24,500. It charges all buyers a 15%premium of the final bid price. How muchdid the bidder pay Christie's? Study the chart on the left and consider what you learned about the Homestead Act.Which of the following statements is accurate?Between 1860 and 1900, most of the people who left the East moved to the South.Between 1860 and 1900, the percentage of people living in the West and Midwest increased.Between 1860 and 1900, the percentage of people living in the South and West decreased. Sulfuric acid (HSO), is formed when sulfur dioxide (SO) reacts with oxygen and water. Using the balanced chemical reaction above, how many moles of HSO are produced from 8.5 moles of SO? can anyone help me with this? How does your nose filter the incoming air? An architect has designed a new hotel shaped like a giant rectangular pyramid. The base of the model for this hotel measures 20 inches by 30 inches, and is 25 in. tall. What is the volume of the pyramid? A una sustancia que tenia una etiqueta poco legible se le determina de iones de 3.16x10 a la -10 M.Calcula su pH determina si se trata de jugo de naranja o leche magneisa How did changing the speed to crank the generator affect the intensity and glow of light bulbs? HELP PLSJeremy drew out the route he will hike over a 3-day period on the coordinate grid below. He will hike from Point A to Point B and from Point B to Point C on the first two days. On day 3, he will hike directly from Point C to Point A.If each grid unit represents a distance of 1 mile, what is the distance Jeremy will need to travel between Point C and Point A?