1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
trasher [3.6K]
3 years ago
13

Part cost Calculator Modify the GUI in your program to look like the following GUI. To do that you need to add the following to

the GUI in the starter program. A text box to accept the part number (Only one is allowed A1B) Note the user may enter spaces before or after the part number and may enter the letters in lower or upper case. You program must accommodate that.

Computers and Technology
1 answer:
Ugo [173]3 years ago
5 0

Answer:

Imports System.Text.RegularExpressions

Public Class Form2

   Private Shared Function Num1(ByVal val As String) As Integer

       Dim retrnVal As String = String.Empty

       Dim collect As MatchCollection = Regex.Matches(val, "\d+")

       For Each mat As Match In collect

           retrnVal += mat.ToString()

       Next

       Return Convert.ToInt32(retrnVal)

   End Function

   Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

       TextBox1.Text = Num1(TextBox1.Text)

       Dim Total As Integer = 0

       Dim A1b As Integer = Convert.ToInt32(TextBox1.Text)

       Label1.Text = 250

       Label2.Text = 25

       If Convert.ToInt32(TextBox1.Text) = A1b Then

           If Convert.ToInt16(Label1.Text) < 10 Then

               Total = 10.5 * Convert.ToInt16(Label1.Text)

           Else

               Total = 8.75 * Convert.ToInt16(Label1.Text)

           End If

           If CheckBox1.Checked Then

               Total = Total + 10

           Else

               Total = Total + 5

           End If

           TextBox2.Text = Convert.ToString(Total)

       End If

End Sub

Explanation:

Please check the answer section and the attachment. Also, please check the method. We have used the regular expression over there. And we have imported the regularexpression library for that. And this is to ensure we can read integer from textbox no matter whether the user inputs empty spaces or characters in lower and upper case in between.

You might be interested in
What is the name of the file manager in Microsoft Windows. The file manager used in Microsoft Windows is?
ahrayia [7]

Its name is file explorer

7 0
3 years ago
Read 2 more answers
Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent singl
victus00 [196]

Answer:

following are the program to the given question:

Program:

x = 0#defining an integer variable that holds a value

if x < 0:#defining if that checks x less than 0

   print("This number ",  x, " is negative.")#print value with the message

else:#defining else block

   if x > 0:#defining if that checks x value greater than 0

       print(x, " is positive")#print value with message

   else:#defining else block

       print(x, " is 0")#print value with message

if x < 0:#defining another if that checks x less than 0

   print("This number ",  x, " is negative.")

elif (x > 0):#defining elif block that check x value greater than 0

   print(x, " is positive")#print value with message

else:#defining else block

   print(x, " is 0")#print value with message

Output:

Please find the attachment file.

Explanation:

In this code, an x variable is defined which holds a value that is "0", in the next step nested conditional statement has used that checks the x variable value and uses the print method that compares the value and prints its value with the message.

In another conditional statement, it uses if that checks x value less than 0 and print value with the negative message.

In the elif block, it checks x value that is greater than 0 and prints the value with the positive message, and in the else block it will print the message that is 0.

3 0
3 years ago
The statements that a programmer writes in a high-level language are called ________.
Andrews [41]
<span>The statements that a programmer writes in a high-level language are called ________.

Source code</span>
4 0
3 years ago
Read 2 more answers
How does the post process alert the user if it detects a hardware problem during the post process?
Lesechka [4]
As a Alert down by the bar under where it says start I would think.
6 0
3 years ago
How do i stop my computer from automatically connecting to a wireless network
Karolina [17]

Answer:

:p

Explanation:      

Should be in wireless network settings.

or

If you have a home wifi or network, lock into that (via connecting and clicking connect automatically or clicking stay connected- depending on the network band and type as well as your computer model and make)

Hope this helps :P    

Have a nice day (or night)

8 0
3 years ago
Other questions:
  • The number of bits used to store color information about each pixel is called ____.
    13·1 answer
  • The technology (software) that automatically downloads website information to your computer is called ________.'
    15·1 answer
  • Which is the correct process for adding page numbers to a spreadsheet you will print? A. Click Page Break Preview. Type the page
    7·1 answer
  • PLEASE HURRY
    6·1 answer
  • Wich is the last step in conducting a URL search
    14·2 answers
  • Write a program using nested loop to produce the following output:
    6·1 answer
  • All of the following are current key technology trends raising ethical issues except:_________
    13·1 answer
  • You want to create Web pages that can easily adapt to and serve multimedia content to smartphones, tablets, gaming devices and s
    13·1 answer
  • What does the action tool allow you to do in Microsoft power point?
    9·1 answer
  • What types of things were often NOT captured in early photographs?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!